[yum-commits] Branch 'yum-3_2_X' - 2 commits - test/depsolvetests.py test/simpleobsoletestests.py test/simpleupdatetests.py

James Antill james at osuosl.org
Mon Jan 5 05:45:42 UTC 2009


 test/depsolvetests.py        |    6 +++---
 test/simpleobsoletestests.py |   22 ++++++++++++++++++++++
 test/simpleupdatetests.py    |    4 ++--
 3 files changed, 27 insertions(+), 5 deletions(-)

New commits:
commit bf05aa0e3a4d886064bac209ae17570687ecba3a
Author: James Antill <james at and.org>
Date:   Mon Jan 5 00:44:17 2009 -0500

    Fix canonArch using test cases for .i386

diff --git a/test/depsolvetests.py b/test/depsolvetests.py
index 51b91e5..12cdcc7 100644
--- a/test/depsolvetests.py
+++ b/test/depsolvetests.py
@@ -329,7 +329,7 @@ class DepsolveTests(DepsolveTests):
         self.xsack.addPackage(xpo64)
 
         self.assertEquals('ok', *self.resolveCode())
-        if os.uname()[-1] == 'x86_64':
+        if self.canonArch == 'x86_64':
             self.assertResult((po, xpo64))
         else:
             self.assertResult((po, xpo))
@@ -648,7 +648,7 @@ class DepsolveTests(DepsolveTests):
 
     def testCompareProvidersSameLen2_noarch_to_64_1(self):
         # Make sure they are still ok, the other way around
-        myarch = arch.getBaseArch(arch.getCanonArch())
+        myarch = self.canonArch
 
         if myarch not in ('i386', 'x86_64'):
             return
@@ -675,7 +675,7 @@ class DepsolveTests(DepsolveTests):
 
     def testCompareProvidersSameLen2_noarch_to_64_2(self):
         # Make sure they are still ok, the other way around
-        myarch = arch.getBaseArch(arch.getCanonArch())
+        myarch = self.canonArch
 
         if myarch not in ('i386', 'x86_64'):
             return
diff --git a/test/simpleupdatetests.py b/test/simpleupdatetests.py
index 10ddd4f..f372e85 100644
--- a/test/simpleupdatetests.py
+++ b/test/simpleupdatetests.py
@@ -100,7 +100,7 @@ class SimpleUpdateTests(OperationsTests):
         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 os.uname()[-1] == 'x86_64':
+        if self.canonArch == 'x86_64':
             self.assertResult((p.update_x86_64, p.requires_update))
         else:
             self.assertResult((p.update_i386, p.requires_update))
@@ -108,7 +108,7 @@ class SimpleUpdateTests(OperationsTests):
         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)
-        if os.uname()[-1] == 'x86_64':
+        if self.canonArch == 'x86_64':
             self.assertResult((p.update_x86_64, p.requires_update))
         else:
             self.assertResult((p.update_i386, p.requires_update))
commit 4d872d80019437077cc9467fe78f19c492967d60
Author: James Antill <james at and.org>
Date:   Mon Jan 5 00:37:52 2009 -0500

    Testcase for multiple packags with the same conflict.

diff --git a/test/simpleobsoletestests.py b/test/simpleobsoletestests.py
index 3c115b3..956516b 100644
--- a/test/simpleobsoletestests.py
+++ b/test/simpleobsoletestests.py
@@ -401,6 +401,28 @@ class SimpleObsoletesTests(OperationsTests):
         self.assert_(res=='ok', msg)
         self.assertResult((dep, pfix2, pnewfix))
 
+    def testConflictMultiplePkgs(self):
+        rp1        = FakePackage('foo', '1', '1', '0', 'noarch')
+
+        aop        = FakePackage('bar', '1', '1', '0', 'noarch')
+        aop.addObsoletes('foo', 'LT', ('0', '1', '2'))
+        ap         = FakePackage('baz', '1', '1', '0', 'noarch')
+        ap.addRequires('d1')
+        ap.addRequires('d2')
+        ap.addRequires('d3')
+
+        dep1        = FakePackage('d1', '1', '1', '0', 'noarch')
+        dep1.addConflicts('foo', 'LT', ('0', '1', '2'))
+        dep2        = FakePackage('d2', '1', '1', '0', 'noarch')
+        dep2.addConflicts('foo', 'LT', ('0', '1', '2'))
+        dep3        = FakePackage('d3', '1', '1', '0', 'noarch')
+        dep3.addConflicts('foo', 'LT', ('0', '1', '2'))
+
+        res, msg = self.runOperation(['install', 'baz'],
+                                     [rp1], [ap, aop, dep1, dep2, dep3])
+        self.assert_(res=='ok', msg)
+        self.assertResult((ap, aop, dep1, dep2, dep3))
+
 
 class GitMetapackageObsoletesTests(OperationsTests):
 


More information about the Yum-commits mailing list