Exemple #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
Exemple #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
Exemple #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
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
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
Exemple #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