def test_alias_input(self): driver = PeriodicDriver() driver.configure({'name':'driver','parent':self.output_value, 'input':self.alias_input}) self.assert_(self.output_value.get() == 0, "Output already non-zero, bogus test...") driver.start() timeout_at = time.time() + 1.0 while self.output_value.get() == 0: if time.time() > timeout_at: self.fail("self.output_value never driven to 1.") pause(0.01) return
def test_simple_case(self): driver = PeriodicDriver() driver.configure({ 'name': 'driver', 'parent': self.output_value, 'input': self.input_value }) self.assert_(self.output_value.get() == 0, "Output already non-zero, bogus test...") driver.start() timeout_at = time.time() + 1.0 while self.output_value.get() == 0: if time.time() > timeout_at: self.fail("self.output_value never driven to 1.") pause(0.01) return
def test_deferred_input(self): driver = PeriodicDriver() driver.configure({'name':'driver','parent':self.output_value, 'input':'/aliases/deferred_input', 'period':0.01}) self.assert_(self.output_value.get() == 0, "Output already non-zero, bogus test...") driver.start() pause(0.1) Alias().configure({'parent':self.aliases, 'name':'deferred_input', 'node_url':'/input/value'}) timeout_at = time.time() + 1.0 while self.output_value.get() == 0: if time.time() > timeout_at: self.fail("self.output_value never driven to 1.") pause(0.01) return
def test_deferred_input(self): driver = PeriodicDriver() driver.configure({ 'name': 'driver', 'parent': self.output_value, 'input': '/aliases/deferred_input', 'period': 0.01 }) self.assert_(self.output_value.get() == 0, "Output already non-zero, bogus test...") driver.start() pause(0.1) Alias().configure({ 'parent': self.aliases, 'name': 'deferred_input', 'node_url': '/input/value' }) timeout_at = time.time() + 1.0 while self.output_value.get() == 0: if time.time() > timeout_at: self.fail("self.output_value never driven to 1.") pause(0.01) return