def setUp(self): DefaultTestFixture.setUp(self) self.root = as_internal_node('/') self.input = CompositeNode() self.output = CompositeNode() self.input.configure({'parent': self.root, 'name': 'input'}) self.output.configure({'parent': self.root, 'name': 'output'}) self.input_value = SimpleValue() self.output_value = SimpleValue() self.input_value.configure({'parent': self.input, 'name': 'value'}) self.output_value.configure({'parent': self.output, 'name': 'value'}) self.aliases = Aliases() self.aliases.configure({'parent': self.root, 'name': 'aliases'}) self.alias_input = Alias() self.alias_input.configure({ 'parent': self.aliases, 'name': 'input', 'node_url': '/input/value' }) self.alias_output = Alias() self.alias_output.configure({ 'parent': self.aliases, 'name': 'output', 'node_url': '/output/value' }) self.input_value.set(1) self.output_value.set(0) return
def test_get(self): sv = SimpleValue() sv.configure({'name': 'simple_value', 'parent': None, 'value': 100}) value = sv.get() self.failIf(value != 100, 'Test get failed, value returned: ' + str(value)) return
def test_20_PeriodicRelayDriver_config(self, quite=0): self.PRINT("ENTER: test_20_PeriodicRelayDriver_config: %s\n", "*" * 15, quite=quite) pts = self.test_10_PeriodicRelayDriver(1) output = SimpleValue() output.configure({'name': 'output', 'parent': None, 'value': 0}) input = SimpleValue() input.configure({'name': 'input', 'parent': None, 'value': 0}) level = 0 # No debugging output. if TestCase.VERBOSE != 0: level = 2 # DEBUG2 pts.configure({ 'parent': output, 'name': 'periodic_relay_driver', 'input': input, 'debug': level }) self.PRINT("EXIT: test_20_PeriodicRelayDriver_config: %s\n", "*" * 15, quite=quite) return pts