Example #1
0
def egg_schema_version_changes(fixture):
    orm_control = SqlAlchemyControl()

    old_version_egg = ReahlEggStub('anegg', '0.0', [])

    orm_control.initialise_schema_version_for(old_version_egg)
    current_version = orm_control.schema_version_for(old_version_egg)
    vassert(current_version == old_version_egg.version)

    new_version_egg = ReahlEggStub('anegg', '0.1', [])
    orm_control.update_schema_version_for(new_version_egg)
    current_version = orm_control.schema_version_for(new_version_egg)
    vassert(current_version == new_version_egg.version)
    vassert(not current_version == old_version_egg.version)
    current_version = orm_control.schema_version_for(old_version_egg)
    vassert(current_version == new_version_egg.version)
Example #2
0
def test_egg_schema_version_changes(reahl_system_fixture):
    orm_control = SqlAlchemyControl()

    old_version_egg = ReahlEggStub('anegg', '0.0', [])

    orm_control.initialise_schema_version_for(old_version_egg)
    current_version = orm_control.schema_version_for(old_version_egg)
    assert current_version == old_version_egg.version

    new_version_egg = ReahlEggStub('anegg', '0.1', [])
    orm_control.update_schema_version_for(new_version_egg)
    current_version = orm_control.schema_version_for(new_version_egg)
    assert current_version == new_version_egg.version
    assert not current_version == old_version_egg.version
    current_version = orm_control.schema_version_for(old_version_egg)
    assert current_version == new_version_egg.version
Example #3
0
def test_egg_schema_version_changes(reahl_system_fixture):
    orm_control = SqlAlchemyControl()

    old_version_egg = ReahlEggStub('anegg', {'0.0': []})

    orm_control.initialise_schema_version_for(old_version_egg)
    current_version = orm_control.schema_version_for(old_version_egg)
    assert current_version == str(
        old_version_egg.installed_version.version_number)

    new_version_egg = ReahlEggStub('anegg', {'0.1': []})
    orm_control.set_schema_version_for(new_version_egg.installed_version)
    current_version = orm_control.schema_version_for(new_version_egg)
    assert current_version == str(
        new_version_egg.installed_version.version_number)
    assert not current_version == str(
        old_version_egg.installed_version.version_number)
    current_version = orm_control.schema_version_for(old_version_egg)
    assert current_version == str(
        new_version_egg.installed_version.version_number)