aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Piotr Jaroszyński <peper@gentoo.org> 2007-09-11 17:52:25 +0000
committerAvatar Piotr Jaroszyński <peper@gentoo.org> 2007-09-11 17:52:25 +0000
commitd3761ac826ef3410977d02a37a755b4a5b1229c0 (patch)
treeaaf8744cfa6ef9197697ae64456c389211fe3d0f
parent281da830d6be844e5e9b297adec7c956cdbf083e (diff)
downloadpaludis-d3761ac826ef3410977d02a37a755b4a5b1229c0.tar.gz
paludis-d3761ac826ef3410977d02a37a755b4a5b1229c0.tar.xz
(python) Fix wrt r3486.
-rw-r--r--python/dep_list.cc4
-rwxr-xr-xpython/dep_list_TEST.py32
2 files changed, 19 insertions, 17 deletions
diff --git a/python/dep_list.cc b/python/dep_list.cc
index 9f362ac..858cfb3 100644
--- a/python/dep_list.cc
+++ b/python/dep_list.cc
@@ -236,6 +236,8 @@ void expose_dep_list()
* DepList
*/
tr1::shared_ptr<DepListOptions> (DepList::* options_ptr)() = &DepList::options;
+ DepList::Iterator (DepList::*dl_begin_ptr)() = &DepList::begin;
+ DepList::Iterator (DepList::*dl_end_ptr)() = &DepList::end;
bp::class_<DepList, boost::noncopyable>
(
"DepList",
@@ -267,6 +269,6 @@ void expose_dep_list()
"Return whether a spec matches an item in the list."
)
-// .def("__iter__", bp::range<bp::return_internal_reference<> >(&DepList::begin, &DepList::end))
+ .def("__iter__", bp::range<bp::return_internal_reference<> >(dl_begin_ptr, dl_end_ptr))
;
}
diff --git a/python/dep_list_TEST.py b/python/dep_list_TEST.py
index d327b51..2f2fcd6 100755
--- a/python/dep_list_TEST.py
+++ b/python/dep_list_TEST.py
@@ -156,11 +156,11 @@ class TestCase_02_DepList(unittest.TestCase):
dl.add(cds, dd)
self.assert_(dl.already_installed(pds, dd))
-### def test_07_entries(self):
-### dl.add(pds, dd)
-###
-### entries = list(dl)
-### self.assert_(isinstance(entries[0], DepListEntry))
+ def test_07_entries(self):
+ dl.add(pds, dd)
+
+ entries = list(dl)
+ self.assert_(isinstance(entries[0], DepListEntry))
class TestCase_03_DepListEntry(unittest.TestCase):
@@ -173,17 +173,17 @@ class TestCase_03_DepListEntry(unittest.TestCase):
def test_01_no_create(self):
self.assertRaises(Exception, DepListEntry)
-### def test_02_data_members(self):
-### dl.add(pds, dd)
-###
-### dle = list(dl)[0]
-###
-### self.assertEquals(dle.kind, DepListEntryKind.PACKAGE)
-### self.assertEquals(dle.package_id.name, "foo/bar")
-### self.assertEquals(dle.associated_entry, None)
-### self.assertEquals(list(dle.tags), [])
-### self.assertEquals(str(dle.destination.name), "installed")
-### self.assertEquals(dle.state, DepListEntryState.HAS_ALL_DEPS)
+ def test_02_data_members(self):
+ dl.add(pds, dd)
+
+ dle = list(dl)[0]
+
+ self.assertEquals(dle.kind, DepListEntryKind.PACKAGE)
+ self.assertEquals(dle.package_id.name, "foo/bar")
+ self.assertEquals(dle.associated_entry, None)
+ self.assertEquals(list(dle.tags), [])
+ self.assertEquals(str(dle.destination.name), "installed")
+ self.assertEquals(dle.state, DepListEntryState.HAS_ALL_DEPS)
if __name__ == "__main__":