def setUp(self): # none of the object's members names should have caps! self.messageformat = MessageFormat(Resource) self.HelloWorld = HelloWorld(Resource) self.msgs = MsgsLists(Resource) with app.app_context(): db.create_all()
def tearDown(self): with app.app_context(): db.session.remove() db.drop_all()
from APIServer.commons.api_utils import err_return, read_json test_config_path = 'APIServer/test_data/test_config.json' APIServer.api_endpoints.config = read_json(test_config_path) app.config['SQLALCHEMY_DATABASE_URI'] = "sqlite:////tmp/test.db" test_json = read_json('APIServer/test_data/test_json.json') test_response = read_json('APIServer/test_data/test_response.json') test_update = read_json('APIServer/test_data/test_update.json') test_update_response = \ read_json('APIServer/test_data/test_update_response.json') SLACK_CONFIG_PATH = 'APIServer/test_data/slack/test_slack.json' slack_config = read_json(SLACK_CONFIG_PATH) with app.app_context(): db.session.remove() db.drop_all() class Test(TestCase): def setUp(self): # none of the object's members names should have caps! self.messageformat = MessageFormat(Resource) self.HelloWorld = HelloWorld(Resource) self.msgs = MsgsLists(Resource) with app.app_context(): db.create_all() def tearDown(self): with app.app_context():