Example #1
0
 def test_local_identifier(self):
     """The separator for the local identifier should be either `.` or `+`"""
     # a valid versionstr should match itself
     versions = ("1.7.0" "1.7.0.post123" "1.7.0.post123.gabcdef9", "1.7.0.post123+gabcdef9")
     for version in versions:
         m = VersionSpec(version)
         self.assertTrue(m.match(version))
Example #2
0
 def test_match(self):
     for vspec, res in [
         ('1.7*', True),   ('1.7.1', True),    ('1.7.0', False),
         ('1.7', False),   ('1.5*', False),    ('>=1.5', True),
         ('!=1.5', True),  ('!=1.7.1', False), ('==1.7.1', True),
         ('==1.7', False), ('==1.7.2', False), ('==1.7.1.0', True),
         ]:
         m = VersionSpec(vspec)
         self.assertEqual(m.match('1.7.1'), res)
Example #3
0
 def test_match(self):
     for vspec, res in [
         ("1.7*", True),
         ("1.7.1", True),
         ("1.7.0", False),
         ("1.7", False),
         ("1.5*", False),
         (">=1.5", True),
         ("!=1.5", True),
         ("!=1.7.1", False),
         ("==1.7.1", True),
         ("==1.7", False),
         ("==1.7.2", False),
         ("==1.7.1.0", True),
     ]:
         m = VersionSpec(vspec)
         self.assertEqual(m.match("1.7.1"), res)