Пример #1
0
def test_egg_schema_version_init(reahl_system_fixture):
    orm_control = SqlAlchemyControl()

    egg = ReahlEggStub('initegg', {'0.0': []})
    orm_control.create_db_tables(None, [egg])
    current_version = orm_control.schema_version_for(egg)
    assert current_version == str(egg.installed_version.version_number)
Пример #2
0
def egg_schema_version_init(fixture):
    orm_control = SqlAlchemyControl()

    egg = ReahlEggStub('initegg', '0.0', [])
    orm_control.create_db_tables(None, [egg])
    current_version = orm_control.schema_version_for(egg)
    vassert(current_version == egg.version)
Пример #3
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)
Пример #4
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
Пример #5
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)
Пример #6
0
from __future__ import print_function, unicode_literals, absolute_import, division
from reahl.sqlalchemysupport import SqlAlchemyControl

reahlsystem.root_egg = 'reahl-component'
#reahlsystem.connection_uri = 'postgresql:///reahl'
reahlsystem.connection_uri = 'sqlite:///:memory:'

reahlsystem.orm_control = SqlAlchemyControl(echo=False)