It returns the "_address" attribute of the classes. This is used for the
"show_processes" command of Boss to provide address information.
"""
pass
+ def address(self):
+ """
+ Provides the name of the address used on the message bus
+
+ You need to provide this method in a concrete implementation.
+ """
+ pass
+
class Component(BaseComponent):
"""
The most common implementation of a component. It can be used either
else:
self._procinfo.process.terminate()
+ def address(self):
+ """
+ Returns the name of the address used on the message bus
+ """
+ return self._address
+
class Configurator:
"""
This thing keeps track of configuration changes and starts and stops
component = self.__create_component('core')
self.assertEqual('No process', component.name())
+ def test_address(self):
+ """
+ Test the address provides whatever we passed to the constructor as process.
+ """
+ component = self.__create_component('core')
+ self.assertEqual("homeless", component.address())
+
def test_guts(self):
"""
Test the correct data are stored inside the component.