def sandbox(tmpdir_factory): ret = Sandbox(tmpdir_factory.get()) with ret.db() as db: create_schema(db) populate_metric_ids(db, tuple(), False) yield ret
def sandbox(tempdir_factory): ret = Sandbox(tempdir_factory.get()) with ret.db() as db: create_schema(db) populate_metric_ids(db, tuple(), False) yield ret
def sandbox(tmpdir): ret = Sandbox(tmpdir.strpath) with ret.db() as db: create_schema(db) populate_metric_ids(db, tuple(), False) return ret
def test_populate_metric_ids(tmpdir): db_path = os.path.join(tmpdir.strpath, 'db.db') with sqlite3.connect(db_path) as db: create_schema(db) populate_metric_ids(db, tuple(), False) results = db.execute('SELECT * FROM metric_names').fetchall() # Smoke test assertion assert (len(results) == len( get_metric_ids(get_metric_parsers_from_args(tuple(), False))))
def test_populate_metric_ids(tmpdir): db_path = os.path.join(tmpdir.strpath, 'db.db') with sqlite3.connect(db_path) as db: create_schema(db) populate_metric_ids(db, tuple(), False) results = db.execute('SELECT * FROM metric_names').fetchall() # Smoke test assertion assert ( len(results) == len(get_metric_ids(get_metric_parsers_from_args(tuple(), False))) )
def populate_metric_ids(cursor): with FakeSqlite(cursor) as c: create_tables.populate_metric_ids(c, [], False)