示例#1
0
def sandbox(tempdir_factory):
    ret = Sandbox(tempdir_factory.get())
    with ret.db() as db:
        create_schema(db)
        populate_metric_ids(db, [], False)

    yield ret
示例#2
0
def sandbox(tempdir_factory):
    ret = Sandbox(tempdir_factory.get())
    with ret.db_logic(writeable=True) as db_logic:
        db_logic.create_schema()
        populate_metric_ids(db_logic, (), False)

    yield ret
示例#3
0
def sandbox(tempdir_factory):
    ret = Sandbox(tempdir_factory.get())
    with ret.db() as db:
        create_schema(db)
        populate_metric_ids(db, (), False)

    yield ret
示例#4
0
def test_populate_metric_ids(tmpdir):
    with WriteableDatabaseLogic.for_tests(tmpdir) as db_logic:
        db_logic.create_schema()
        populate_metric_ids(db_logic, (), False)

        results = db_logic._fetch_all('SELECT * FROM metric_names')
        # Smoke test assertion
        assert results
示例#5
0
def test_populate_metric_ids(tmpdir):
    with sqlite3.connect(tmpdir.join('db.db').strpath) as db:
        create_schema(db)
        populate_metric_ids(db, [], False)

        results = db.execute('SELECT * FROM metric_names').fetchall()
        # Smoke test assertion
        assert results
示例#6
0
def test_populate_metric_ids(tmpdir):
    with sqlite3.connect(tmpdir.join('db.db').strpath) as db:
        create_schema(db)
        populate_metric_ids(db, (), False)

        results = db.execute('SELECT * FROM metric_names').fetchall()
        # Smoke test assertion
        assert results