Exemple #1
0
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)
Exemple #2
0
def test_detect_05(db, with_schema):
    with db.begin():
        db.execute("DROP TABLE configuration")
    assert detect_version(db) == '0.5'
Exemple #3
0
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'
Exemple #4
0
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'