def test_too_ancient(db, with_schema): with db.begin(): db.execute("DROP TABLE configuration") db.execute("DROP TABLE files CASCADE") with pytest.raises(RuntimeError) as exc: detect_version(db) assert 'Database version older than 0.4' in str(exc)
def test_detect_05(db, with_schema): with db.begin(): db.execute("DROP TABLE configuration") assert detect_version(db) == '0.5'
def test_detect_04(db, with_schema): with db.begin(): db.execute("DROP TABLE configuration") db.execute("DROP VIEW statistics") assert detect_version(db) == '0.4'
def test_detect_05(db, with_schema): with db.begin(): db.execute("DROP TABLE configuration") db.execute("CREATE VIEW statistics(i) AS VALUES (1)") assert detect_version(db) == '0.5'