Ejemplo n.º 1
0
    def test_startup_check_version_exit(self):
        from ptah.migrate import revision, check_version

        ptah.register_migration('test1', 'ptah.tests1:migrations')
        ptah.register_migration('test2', 'ptah.tests2:migrations')
        self.init_ptah()

        revision('test1', message='Test message1')
        revision('test2', message='Test message2')

        exc = None
        try:
            check_version(None)
        except SystemExit as err:  # pragma: no cover
            exc = err

        self.assertIsInstance(exc, SystemExit)
Ejemplo n.º 2
0
    def test_startup_check_version_exit(self):
        from ptah.migrate import Version, revision, check_version

        ptah.register_migration(
            'test1', 'ptah.tests1:migrations')
        ptah.register_migration(
            'test2', 'ptah.tests2:migrations')
        self.init_ptah()

        rev1 = revision('test1', message='Test message1')
        rev2 = revision('test2', message='Test message2')

        exc = None
        try:
            check_version(None)
        except SystemExit as err: # pragma: no cover
            exc = err

        self.assertIsInstance(exc, SystemExit)
Ejemplo n.º 3
0
    def test_startup_check_version(self):
        from ptah.migrate import Version, revision, check_version

        ptah.register_migration('test1', 'ptah.tests1:migrations')
        ptah.register_migration('test2', 'ptah.tests2:migrations')
        self.init_ptah()

        rev1 = revision('test1', message='Test message1')
        rev2 = revision('test2', message='Test message2')

        session = ptah.get_session()
        session.add(Version(package='test1', version_num=rev1))
        session.add(Version(package='test2', version_num=rev2))
        session.flush()

        exc = None
        try:
            check_version(None)
        except SystemExit as err:  # pragma: no cover
            exc = err

        self.assertIsNone(exc)
Ejemplo n.º 4
0
    def test_startup_check_version(self):
        from ptah.migrate import Version, revision, check_version

        ptah.register_migration(
            'test1', 'ptah.tests1:migrations')
        ptah.register_migration(
            'test2', 'ptah.tests2:migrations')
        self.init_ptah()

        rev1 = revision('test1', message='Test message1')
        rev2 = revision('test2', message='Test message2')

        session = ptah.get_session()
        session.add(Version(package='test1', version_num=rev1))
        session.add(Version(package='test2', version_num=rev2))
        session.flush()

        exc = None
        try:
            check_version(None)
        except SystemExit as err: # pragma: no cover
            exc = err

        self.assertIsNone(exc)