Esempio n. 1
0
    def test_flow(self):
        version = Version('1.4.0')
        assert str(version) == '1.4.0'

        version.start_development()
        assert str(version) == '1.4.0.dev1'

        version.increase('dev')
        assert str(version) == '1.4.0.dev2'

        version.finish_development()
        assert str(version) == '1.4.1'
Esempio n. 2
0
    def test_increments(self):
        version = Version('1.4.0')
        assert str(version) == '1.4.0'

        version.increase('major')
        assert str(version) == '2.0.0'

        version.increase('minor')
        assert str(version) == '2.1.0'

        version.increase('patch')
        assert str(version) == '2.1.1'

        version.increase('dev')
        assert str(version) == '2.1.1.dev1'

        version.increase('patch')
        assert str(version) == '2.1.2'

        version.increase('minor')
        assert str(version) == '2.2.0'

        with raises(ValueError) as exc:
            version.increase('unknown')

        assert str(exc.value) == 'Unknown version part `unknown`.'