def test_parse(self): p1 = Package.parse(" foo - 1.2 ") self.assertEqual(p1.name, "foo") self.assertEqual(p1.version, "1.2.0") p2 = Package.parse(" foo - 1.2 ; depends bar >2,<3,>2.5; depends baz") self.assertTrue(Requirement.parse("bar >2,<3,>2.5") in p2.dependencies) self.assertTrue(Requirement.parse("baz") in p2.dependencies) self.assertEqual(len(p2.dependencies), 2)