aboutsummaryrefslogtreecommitdiff
path: root/python/dep_spec_TEST.py
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-07-18 19:48:40 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-07-18 19:48:40 +0000
commitb0984f6e15f2da0e52dd341d1bab63f94de927b8 (patch)
tree1c8815e09a64a0d0aeade3bbc30d5af6d8b5fc1d /python/dep_spec_TEST.py
parent6dfe78633a6155bb6231e996cfb2ac2bce3157bd (diff)
downloadpaludis-b0984f6e15f2da0e52dd341d1bab63f94de927b8.tar.gz
paludis-b0984f6e15f2da0e52dd341d1bab63f94de927b8.tar.xz
Make EAPIs, dep parsing ERepository specific. Fixes: ticket:316
Diffstat (limited to 'python/dep_spec_TEST.py')
-rwxr-xr-xpython/dep_spec_TEST.py62
1 files changed, 30 insertions, 32 deletions
diff --git a/python/dep_spec_TEST.py b/python/dep_spec_TEST.py
index 35051f6a5..232159fe4 100755
--- a/python/dep_spec_TEST.py
+++ b/python/dep_spec_TEST.py
@@ -69,45 +69,43 @@ class TestCase_1_DepSpecs(unittest.TestCase):
self.assertEquals(self.pds.version_requirements_mode, VersionRequirementsMode.AND)
def test_09_use_requirements(self):
- eapi = EAPIData.instance.eapi_from_string("paludis-1")
- spec = PortageDepParser.parse_depend("foo/monkey[foo]", eapi)
- ur = iter(iter(spec).next().use_requirements).next()
+ spec = PackageDepSpec("foo/monkey[foo]", PackageDepSpecParseMode.PERMISSIVE)
+ ur = iter(spec.use_requirements).next()
self.assertEquals(str(ur[0]), "foo")
self.assertEquals(ur[1], UseFlagState.ENABLED)
def test_10_without_use_requirements(self):
- eapi = EAPIData.instance.eapi_from_string("paludis-1")
- spec = PortageDepParser.parse_depend("foo/monkey[foo]", eapi)
- pds = iter(spec).next().without_use_requirements()
+ spec = PackageDepSpec("foo/monkey[foo]", PackageDepSpecParseMode.PERMISSIVE)
+ pds = spec.without_use_requirements()
self.assertEquals(pds.use_requirements, None)
self.assertEquals(str(pds), "foo/monkey")
- def test_11_composites(self):
- eapi = EAPIData.instance.eapi_from_string("0")
- spec = PortageDepParser.parse_depend("|| ( foo/bar foo/baz ) foo/monkey", eapi)
-
- self.assert_(isinstance(spec, CompositeDepSpec))
- self.assert_(isinstance(spec, AllDepSpec))
-
- self.assertEqual(len(list(spec)), 2)
-
- for i, subspec1 in enumerate(spec):
- if i == 0:
- self.assert_(isinstance(subspec1, AnyDepSpec))
- for j, subspec2 in enumerate(subspec1):
- if j == 0:
- self.assert_(isinstance(subspec2, PackageDepSpec))
- self.assertEquals(str(subspec2), "foo/bar")
- elif j == 1:
- self.assert_(isinstance(subspec2, PackageDepSpec))
- self.assertEquals(str(subspec2), "foo/baz")
- else:
- self.assertEquals("Too many items", "OK")
- elif i == 1:
- self.assert_(isinstance(subspec1, PackageDepSpec))
- self.assertEquals(str(subspec1), "foo/monkey")
- else:
- self.assertEquals("Too many items", "OK")
+### def test_11_composites(self):
+### eapi = EAPIData.instance.eapi_from_string("0")
+### spec = PortageDepParser.parse_depend("|| ( foo/bar foo/baz ) foo/monkey", eapi)
+###
+### self.assert_(isinstance(spec, CompositeDepSpec))
+### self.assert_(isinstance(spec, AllDepSpec))
+###
+### self.assertEqual(len(list(spec)), 2)
+###
+### for i, subspec1 in enumerate(spec):
+### if i == 0:
+### self.assert_(isinstance(subspec1, AnyDepSpec))
+### for j, subspec2 in enumerate(subspec1):
+### if j == 0:
+### self.assert_(isinstance(subspec2, PackageDepSpec))
+### self.assertEquals(str(subspec2), "foo/bar")
+### elif j == 1:
+### self.assert_(isinstance(subspec2, PackageDepSpec))
+### self.assertEquals(str(subspec2), "foo/baz")
+### else:
+### self.assertEquals("Too many items", "OK")
+### elif i == 1:
+### self.assert_(isinstance(subspec1, PackageDepSpec))
+### self.assertEquals(str(subspec1), "foo/monkey")
+### else:
+### self.assertEquals("Too many items", "OK")
if __name__ == "__main__":
unittest.main()