Esempio n. 1
0
    def test_invalid_swift_version(self):
        swift_version_type = types.SwiftVersionType()

        with self.assertRaises(ArgumentTypeError):
            swift_version_type('2')
            swift_version_type('1.8.0.2.3')
            swift_version_type('100.0.56.1.85')
Esempio n. 2
0
    def test_valid_swift_version(self):
        swift_version_type = types.SwiftVersionType()

        version = swift_version_type('1.0')
        self.assertIsInstance(version, Version)
        self.assertEqual(version.components, (1, 0))

        version = swift_version_type('1.0.1')
        self.assertIsInstance(version, Version)
        self.assertEqual(version.components, (1, 0, 1))

        swift_version_type('1.0')
        swift_version_type('3.0.2')
        swift_version_type('200.0.56')
        swift_version_type('100000.0.1')