Make load path relative to file
authorKlaus Kämpf <kkaempf@suse.de>
Tue, 9 Nov 2010 10:13:05 +0000 (11:13 +0100)
committerKlaus Kämpf <kkaempf@suse.de>
Tue, 9 Nov 2010 10:13:05 +0000 (11:13 +0100)
swig/python/tests/arch.py
swig/python/tests/commit_callbacks.py
swig/python/tests/loading.py
swig/python/tests/repoinfo.py
swig/python/tests/starting.py

index 4451da8..524d217 100644 (file)
@@ -3,8 +3,11 @@
 #
 import unittest
 
+import os 
+cwd = os.path.abspath(os.path.dirname(__file__)) 
+
 import sys
-sys.path.insert(0, '../../../build/swig/python')
+sys.path.insert(0, cwd + "/../../../build/swig/python")
 from zypp import Arch
 
 class TestSequenceFunctions(unittest.TestCase):
index 61c9315..c969927 100644 (file)
@@ -4,8 +4,11 @@
 
 import unittest
 
+import os 
+cwd = os.path.abspath(os.path.dirname(__file__)) 
+
 import sys
-sys.path.insert(0, '../../../../build/swig/python')
+sys.path.insert(0, cwd + "/../../../build/swig/python")
 
 from zypp import CommitCallbacks
 
@@ -16,12 +19,19 @@ class CommitReceiver:
 class CommitCallbacksTestCase(unittest.TestCase):
     def testRemoveCallback(self):
         commit_callbacks = CommitCallbacks()
+#        print "commit_callbacks " , commit_callbacks
         assert None == commit_callbacks.receiver()
+#        print "callbacks receiver is NULL - good"
         commit_receiver = CommitReceiver()
+#        print "receiver is ", commit_receiver
         commit_callbacks.connect(commit_receiver)
+#        print "connected to ", commit_receiver
         assert commit_receiver == commit_callbacks.receiver()
+#        print "callbacks receiver is set - good"
         commit_callbacks.disconnect()
+#        print "disconnected"
         assert None == commit_callbacks.receiver()
+#        print "callbacks receiver is NULL - good"
 
 if __name__ == '__main__':
   unittest.main()
index c3b6b40..4072ea7 100644 (file)
@@ -1,7 +1,10 @@
 import unittest
 
+import os 
+cwd = os.path.abspath(os.path.dirname(__file__)) 
+
 import sys
-sys.path.insert(0, '../../../../build/swig/python')
+sys.path.insert(0, cwd + "/../../../build/swig/python")
 
 class TestSequenceFunctions(unittest.TestCase):
     
index 12587f4..140fcaf 100644 (file)
@@ -5,8 +5,11 @@
 
 import unittest
 
+import os 
+cwd = os.path.abspath(os.path.dirname(__file__)) 
+
 import sys
-sys.path.insert(0, '../../../../build/swig/python')
+sys.path.insert(0, cwd + "/../../../build/swig/python")
 
 from zypp import RepoInfo, Url, UrlSet, RepoType
 
index ce9258d..c97193f 100755 (executable)
@@ -1,7 +1,10 @@
 import unittest
 
+import os 
+cwd = os.path.abspath(os.path.dirname(__file__)) 
+
 import sys
-sys.path.insert(0, '../../../build/swig/python')
+sys.path.insert(0, cwd + "/../../../build/swig/python")
 
 class TestSequenceFunctions(unittest.TestCase):