summaryrefslogtreecommitdiff
path: root/swig/python
diff options
context:
space:
mode:
authorKlaus Kämpf <kkaempf@suse.de>2010-12-06 14:41:23 +0100
committerKlaus Kämpf <kkaempf@suse.de>2010-12-06 14:41:23 +0100
commita35529dc50aa907f9f1c3a4f05158bc7f4debbc0 (patch)
tree2b479391ec303eeb100b8fb2da499280f1b2f8a8 /swig/python
parent75f229e2e5fe0eb858aa71819150f27c16f95627 (diff)
downloadlibzypp-bindings-a35529dc50aa907f9f1c3a4f05158bc7f4debbc0.tar.gz
libzypp-bindings-a35529dc50aa907f9f1c3a4f05158bc7f4debbc0.tar.bz2
libzypp-bindings-a35529dc50aa907f9f1c3a4f05158bc7f4debbc0.zip
Fix Problems iterator in Python
Diffstat (limited to 'swig/python')
-rw-r--r--swig/python/tests/CMakeLists.txt3
-rw-r--r--swig/python/tests/problems.py21
2 files changed, 23 insertions, 1 deletions
diff --git a/swig/python/tests/CMakeLists.txt b/swig/python/tests/CMakeLists.txt
index 8424cc0..e35d3ac 100644
--- a/swig/python/tests/CMakeLists.txt
+++ b/swig/python/tests/CMakeLists.txt
@@ -6,4 +6,5 @@ ENABLE_TESTING()
ADD_TEST(bindings_python_loading python ${CMAKE_CURRENT_SOURCE_DIR}/loading.py)
ADD_TEST(bindings_python_repoinfo python ${CMAKE_CURRENT_SOURCE_DIR}/repoinfo.py)
-ADD_TEST(bindings_python_commit_callbacks python ${CMAKE_CURRENT_SOURCE_DIR}/commit_callbacks.py) \ No newline at end of file
+ADD_TEST(bindings_python_commit_callbacks python ${CMAKE_CURRENT_SOURCE_DIR}/commit_callbacks.py)
+ADD_TEST(bindings_python_problems python ${CMAKE_CURRENT_SOURCE_DIR}/problems.py)
diff --git a/swig/python/tests/problems.py b/swig/python/tests/problems.py
new file mode 100644
index 0000000..0406290
--- /dev/null
+++ b/swig/python/tests/problems.py
@@ -0,0 +1,21 @@
+import unittest
+
+import os
+cwd = os.path.abspath(os.path.dirname(__file__))
+
+import sys
+sys.path.insert(0, cwd + "/../../../build/swig/python")
+
+class TestSequenceFunctions(unittest.TestCase):
+
+ def testproblems(self):
+ import zypp
+ Z = zypp.ZYppFactory.instance().getZYpp()
+ assert Z
+ if not Z.resolver().resolvePool():
+ for problem in Z.resolver().problems():
+ print "Problem %s" % problem.description()
+# raise "Solver Error"
+
+if __name__ == '__main__':
+ unittest.main()