def test_version_cmp(self):
        """test comparsion of 'libversion.Version()'-instances"""
        to_test = [
            # format: (vs1, op, vs2, res)
            # testdata for general equality
            ("1.0.0",
             operator.eq,
             "1.0.0",
             True),
            ("1.0.0",
             operator.eq,
             "0!1.0.0",
             True),
            ("1.0.0",
             operator.eq,
             "1!1.0.0",
             False),
            ("1.0.0",
             operator.eq,
             "1.0.0.post",
             False),
            ("1.0.0",
             operator.eq,
             "1.0.0a",
             False),
            ("1.0.0",
             operator.eq,
             "1.0.0b",
             False),
            ("1.0.0.post1",
             operator.eq,
             "1.0.0.post2",
             False),
            ("1.0.0.post",
             operator.eq,
             "1.0.0.post0",
             True),
            ("1.0.0.post",
             operator.eq,
             "1.0.0.dev",
             False),
            # testdata for main version comparsion
            ("1.2.3",
             operator.eq,
             "1.5.0",
             False),
            ("2.0.3",
             operator.gt,
             "1.9.7",
             True),
            ("1.9.7",
             operator.gt,
             "2.0.3",
             False),
            ("1.9.7",
             operator.lt,
             "2.0.3",
             True),
            ("1.9.7",
             operator.lt,
             "1.9.7",
             False),
            ("1.9.7",
             operator.le,
             "1.9.7",
             True),
            ("2.4.9",
             operator.gt,
             "11.0.5",
             False),
            ("2.4.9",
             operator.gt,
             "1.0.5",
             True),
            ("2.4.9",
             operator.gt,
             "2.5.1",
             False),
            ("2.5.2",
             operator.gt,
             "2.5.1",
             True),
            # testdata for rtype comparsion
            ("1.0.0",
             operator.eq,
             "1.0.0a",
             False),
            ("1.0.0",
             operator.eq,
             "1.0.0b",
             False),
            ("1.0.0",
             operator.eq,
             "1.0.0rc",
             False),
            ("1.0.0a",
             operator.eq,
             "1.0.0b",
             False),
            ("1.0.0a",
             operator.eq,
             "1.0.0rc",
             False),
            ("1.0.0b",
             operator.eq,
             "1.0.0rc",
             False),
            ("1.0.0",
             operator.gt,
             "1.0.0rc",
             True),
            ("1.0.0rc",
             operator.gt,
             "1.0.0b",
             True),
            ("1.0.0b",
             operator.gt,
             "1.0.0a",
             True),
            ("1.0.0",
             operator.gt,
             "1.0.0b",
             True),
            ("1.0.0",
             operator.gt,
             "1.0.0a",
             True),
            ("1.0.0rc",
             operator.gt,
             "1.0.0a",
             True),
            # testdata for dev version comparsion
            ("1.0.0",
             operator.gt,
             "1.0.0.dev",
             True),
            ("1.0.0",
             operator.gt,
             "1.0.0.dev1000",
             True),
            ("1.0.0.dev",
             operator.gt,
             "1.0.0",
             False),
            ("1.0.0.dev2",
             operator.gt,
             "1.0.0.dev",
             True),
        ]
        for vs1, op, vs2, expected in to_test:
            v1 = self.stash.libversion.Version.parse(vs1)
            v2 = self.stash.libversion.Version.parse(vs2)
            self.assertEqual(op(v1, v2), expected)
test comparsion of 'libversion.Version()'-instances
tests/lib/test_libversion.py