[yum-git] 2 commits - Makefile test/check-po-yes-no.py test/depsolvetests.py test/simpleupdatetests.py

James Antill james at linux.duke.edu
Sat Apr 12 18:53:41 UTC 2008


 Makefile                  |    1 +
 test/check-po-yes-no.py   |   40 +++++++++++++++++++++++++---------------
 test/depsolvetests.py     |    7 ++++++-
 test/simpleupdatetests.py |   15 ++++++++++++++-
 4 files changed, 46 insertions(+), 17 deletions(-)

New commits:
commit 16bcfc8c3e2e2b33a20c70a5eecb9175e21b1add
Author: James Antill <james at and.org>
Date:   Sat Apr 12 14:53:31 2008 -0400

    Show problems with update for deps. and multi arch Fix other multiarch tests

diff --git a/test/depsolvetests.py b/test/depsolvetests.py
index 17cb537..fd25836 100644
--- a/test/depsolvetests.py
+++ b/test/depsolvetests.py
@@ -2,6 +2,8 @@ import unittest
 from testbase import *
 from rpmUtils import arch
 
+import rpmUtils.arch
+
 class DepsolveTests(DepsolveTests):
     def testEmpty(self):
         po = FakePackage('zsh', '1', '1', None, 'i386')
@@ -327,7 +329,10 @@ class DepsolveTests(DepsolveTests):
         self.xsack.addPackage(xpo64)
 
         self.assertEquals('ok', *self.resolveCode())
-        self.assertResult((po, xpo))
+        if rpmUtils.arch.getBestArch() == 'x86_64':
+            self.assertResult((po, xpo64))
+        else:
+            self.assertResult((po, xpo))
 
     def testUpdateSinglePackage(self):
         ipo = FakePackage('zsh', '1', '1', None, 'i386')
diff --git a/test/simpleupdatetests.py b/test/simpleupdatetests.py
index 485de54..fe4f414 100644
--- a/test/simpleupdatetests.py
+++ b/test/simpleupdatetests.py
@@ -1,5 +1,7 @@
 from testbase import *
 
+import rpmUtils.arch
+
 class SimpleUpdateTests(OperationsTests):
 
     """This test suite runs three different type of tests - for all possible
@@ -94,11 +96,22 @@ class SimpleUpdateTests(OperationsTests):
             self.assertResult((p.update_x86_64,), (p.update_i386,)) # ?
         else:
             self.assertResult((p.update_i386, p.update_x86_64))
+    def testUpdatenoarchToMultilibForDependencyRev(self):
+        p = self.pkgs
+        res, msg = self.runOperation(['install', 'zsh-utils'], [p.installed_noarch], [p.update_x86_64, p.update_i386, p.requires_update])
+        self.assert_(res=='ok', msg)
+        if rpmUtils.arch.getBestArch() == 'x86_64':
+            self.assertResult((p.update_x86_64, p.requires_update))
+        else:
+            self.assertResult((p.update_i386, p.requires_update))
     def testUpdatenoarchToMultilibForDependency(self):
         p = self.pkgs
         res, msg = self.runOperation(['install', 'zsh-utils'], [p.installed_noarch], [p.update_i386, p.update_x86_64, p.requires_update])
         self.assert_(res=='ok', msg)
-        self.assertResult((p.update_x86_64, p.requires_update), (p.update_i386,))
+        if rpmUtils.arch.getBestArch() == 'x86_64':
+            self.assertResult((p.update_x86_64, p.requires_update))
+        else:
+            self.assertResult((p.update_i386, p.requires_update))
     def testUpdatenoarchToMultilibForDependency2(self):
         p = self.pkgs
         res, msg = self.runOperation(['update', 'bar'], [p.required, p.installed_noarch],
commit 15106d8c27b48740761c71e94b9530a5b120d86f
Author: James Antill <james at and.org>
Date:   Sat Apr 12 14:13:15 2008 -0400

    Add check-po-yes-no.py to make check

diff --git a/Makefile b/Makefile
index 48b7333..f9e8d76 100644
--- a/Makefile
+++ b/Makefile
@@ -46,6 +46,7 @@ doccheck:
 
 test:
 	@nosetests -i ".*test" test
+	@test/check-po-yes-no.py
 
 check: test
 
diff --git a/test/check-po-yes-no.py b/test/check-po-yes-no.py
index 735a3ca..5b870d6 100755
--- a/test/check-po-yes-no.py
+++ b/test/check-po-yes-no.py
@@ -8,26 +8,36 @@ import glob
 
 for fname in glob.glob("po/*.po"):
     next = None
-    is_this_ok = None
-    yes = None
-    y   = None
-    no  = None
-    n   = None
+    is_this_ok  = None
+    sis_this_ok = None
+    yes         = None
+    syes        = None
+    y           = None
+    sy          = None
+    no          = None
+    sno         = None
+    n           = None
+    sn          = None
     for line in file(fname):
         if next is not None:
             if next == 'is_this_ok':
+                sis_this_ok = line
                 if line == 'msgstr ""\n' or line.find('[y/N]') != -1:
                     is_this_ok = False
                 else:
                     is_this_ok = True
             if next == 'yes':
-                yes = line != 'msgstr ""\n'
+                syes = line
+                yes  = line != 'msgstr ""\n'
             if next == 'y':
-                y   = line != 'msgstr ""\n'
+                sy   = line
+                y    = line != 'msgstr ""\n'
             if next == 'no':
-                no  = line != 'msgstr ""\n'
+                sno  = line
+                no   = line != 'msgstr ""\n'
             if next == 'n':
-                n   = line != 'msgstr ""\n'
+                sn   = line
+                n    = line != 'msgstr ""\n'
             next = None
             continue
         if line == 'msgid "Is this ok [y/N]: "\n':
@@ -65,10 +75,10 @@ n   %s
         is_this_ok != n):
         print >>sys.stderr, """\
 ERROR: yes/no translations don't match in: %s
-is_this_ok %s
-yes %s
-y   %s
-no  %s
-n   %s
+is_this_ok %5s: %s\
+yes        %5s: %s\
+y          %5s: %s\
+no         %5s: %s\
+n          %5s: %s\
 """ % (fname,
-       is_this_ok, yes, y, no, n)
+       is_this_ok, sis_this_ok, yes, syes, y, sy, no, sno, n, sn)



More information about the Yum-cvs-commits mailing list