def setUp(self): app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:////tmp/test.db' app.config['SPOTCLOUD_USER'] = '******' app.config['SPOTCLOUD_PASSWD'] = 'password' db.drop_all() db.create_all() self.app = app.test_client() pkg_uuid = str(uuid.uuid1()) self.pkg = Package(ecp_uuid=pkg_uuid, nova_id='dummy_nova_id', state='ready') db.session.add(self.pkg) db.session.commit() hardware_uuid = str(uuid.uuid1()) self.hardware = HardwareTemplate( ecp_uuid=hardware_uuid, name='test', nova_id='dummy_nova_id', cpus=2, arch='i386', memory=8000) db.session.add(self.hardware) db.session.commit()
def init_db(uri=None): """ Drop then create all tables, fill them with initial data """ if uri: app.config['SQLALCHEMY_DATABASE_URI'] = uri db.drop_all() db.create_all() HardwareTemplate.sync_with_nova()
def setUp(self): app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:////tmp/test.db' app.config['SPOTCLOUD_USER'] = '******' app.config['SPOTCLOUD_PASSWD'] = 'password' db.drop_all() db.create_all() self.app = app.test_client() pkg_uuid = str(uuid.uuid1()) self.pkg = Package(ecp_uuid=pkg_uuid, nova_id='dummy_nova_id', state='ready') db.session.add(self.pkg) db.session.commit() hardware_uuid = str(uuid.uuid1()) self.hardware = HardwareTemplate(ecp_uuid=hardware_uuid, name='test', nova_id='dummy_nova_id', cpus=2, arch='i386', memory=8000) db.session.add(self.hardware) db.session.commit()