def test_weather_module(self): steward = Steward({'db_url': 'sqlite://', 'modules': {'input': [{'name': 'weather', 'place_name': 'West Jordan', 'lat': '40.5955', 'lon': '-111.961'}]}}) steward.run() engine = steward.getDbEngine() result = engine.execute("select * from weather order by forecast_date ASC") self.assertTrue(True)
def test_load_module(self): steward = Steward({'epubOutput': True, 'modules': {'input': [{'name': 'test_module'}], 'output': [{'name': 'test_module'}]}}) steward.run() self.assertTrue(steward.getModule('input','test_module')[0].hasConfig) self.assertTrue(steward.getModule('output','test_module')[0].hasConfig) self.assertTrue(steward.getModule('input','test_module')[0].hasRun) self.assertTrue(steward.getModule('output','test_module')[0].hasRun)
def verify_check_boxes(self): """ Checks the type of user checked """ if self.patient.active: print("patient") AGENT = Agent('Patient') elif self.doctor.active: print("doctor") AGENT = Agent('Doctor') elif self.state.active: print("state") AGENT = Steward('State') else: print("none selected") invalid_login("Must select type of user.") self.reset() wm.current = "main" return AGENT
def test_setup_module(self): steward = Steward({'modules': {'input': [{'name': 'test_module'}], 'output': [{'name': 'test_module'}]}}) steward.setupModules() self.assertTrue(steward.getModule('input','test_module')[0].hasConfig) self.assertTrue(steward.getModule('output','test_module')[0].hasConfig)
def test_get_engine(self): steward = Steward({'db_url': 'sqlite:////tmp/steward.db'}) engine = steward.getDbEngine() Base.metadata.create_all(engine) self.assertTrue(os.path.isfile('/tmp/steward.db')) os.unlink('/tmp/steward.db')
def test_config(self): steward = Steward({'hello': 1, 'there': 42}) self.assertEqual(steward.getConfig('hello'), 1) self.assertEqual(steward.getConfig('there'), 42)
def test_run(self): steward = Steward() steward.run() self.assertEqual(True, True)