def setUp(self): """ Configure the execution of each test in the class. Get the app for testing and create the testing DB. :return: Nothing. """ self.app = app.app.test_client() self.app.testing = True app.app.config['SQLALCHEMY_DATABASE_URI'] = TEST_SQLALCHEMY_DATABASE_URI db.create_all() image1 = GlanceSyncImage(region='Valladolid', name='image10', id='010', status='active', size=1073741914, checksum='b1d5781111d84f7b3fe45a0852e59758cd7a87e5', owner='tenant1', is_public=True, user_properties={'type': 'baseimage'}) image2 = GlanceSyncImage(region='Valladolid', name='image20', id='020', status='active', size=1073741916, checksum='d885781111d84f7b3fe45a0852e59758cd7a87e5', owner='tenant1', is_public=True, user_properties={'type': 'baseimage'}) images_region = [image1, image2] self.config = { 'return_value.get_images_region.return_value': images_region }
def setUp(self): """ Configure the execution of each test in the class. Create the testing DB. :return: Nothing. """ app.app.config['SQLALCHEMY_DATABASE_URI'] = TEST_SQLALCHEMY_DATABASE_URI db.create_all()
def setUp(self): """ Configure the execution of each test in the class. Create the testing DB. :return: Nothing. """ app.app.config[ 'SQLALCHEMY_DATABASE_URI'] = TEST_SQLALCHEMY_DATABASE_URI db.create_all()
def setUp(self): """ Configure the test environment with the creation of the DB and storing some data to test it. :return: Nothing. """ db.create_all() # create users: user1 = User(region='Spain', name='*****@*****.**', task_id='1234', role='fake role', status=Task.SYNCED) user2 = User(region='Spain2', name='*****@*****.**', task_id='5678', role='fake role', status=Task.SYNCING) db.session.add(user1) db.session.add(user2) db.session.commit()
def setUp(self): """ Configure the execution of each test in the class. Get the app for testing and create the testing DB. :return: Nothing. """ self.app = app.app.test_client() self.app.testing = True app.app.config[ 'SQLALCHEMY_DATABASE_URI'] = TEST_SQLALCHEMY_DATABASE_URI db.create_all() image1 = GlanceSyncImage( region='Valladolid', name='image10', id='010', status='active', size=1073741914, checksum='b1d5781111d84f7b3fe45a0852e59758cd7a87e5', owner='tenant1', is_public=True, user_properties={'type': 'baseimage'}) image2 = GlanceSyncImage( region='Valladolid', name='image20', id='020', status='active', size=1073741916, checksum='d885781111d84f7b3fe45a0852e59758cd7a87e5', owner='tenant1', is_public=True, user_properties={'type': 'baseimage'}) images_region = [image1, image2] self.config = { 'return_value.get_images_region.return_value': images_region }