def minimal_db_initialization(request): with db.session(ephemeral=True): db['Queue'].create(name='default', priority=3, scheduler_policy='kamelot', state='Active') # add some resources for i in range(5): db['Resource'].create(network_address="localhost" + str(int(i / 2))) yield
def minimal_db_initialization(request): with db.session(ephemeral=True): db["Queue"].create(name="default", priority=3, scheduler_policy="kamelot", state="Active") # add some resources for i in range(5): db["Resource"].create(network_address="localhost") yield
def minimal_db_initialization(request): with db.session(ephemeral=True): # add some resources for i in range(5): db['Resource'].create(network_address="localhost") db['Queue'].create(name='default') yield
def minimal_db_initialization(request): with db.session(ephemeral=True): for i in range(5): db['Resource'].create(network_address="localhost") for i in range(5): insert_job(res=[(60, [('resource_id=2', "")])], properties="") yield
def test_read_only_session(): from oar.lib import db lenght = len(db['Resource'].query.all()) if db.dialect == "sqlite": exception = OperationalError else: exception = ProgrammingError with assert_raises(exception): with db.session(read_only=True): assert len(db['Resource'].query.all()) == lenght db['Resource'].create() len(db['Resource'].query.all()) == lenght
def minimal_db_initialization(request): db.delete_all() with db.session(ephemeral=True): db['Queue'].create(name='default', priority=3, scheduler_policy='kamelot', state='Active') # add some resources for i in range(5): db['Resource'].create(network_address="localhost" + str(int(i / 2))) db.session.execute(AdmissionRule.__table__.delete()) db['AdmissionRule'].create(rule="name='yop'") yield
def minimal_db_initialization(request): with db.session(ephemeral=True): yield
def minimal_db_initialization(request): with db.session(ephemeral=True): here = os.path.abspath(os.path.dirname(__file__)) filename = os.path.join(here, "data", "dataset_1.json") load_fixtures(db, filename, ref_time=REFTIME, clear=True) yield