summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorbiao716.wang <biao716.wang@samsung.com>2022-08-02 19:18:29 +0900
committerbiao716.wang <biao716.wang@samsung.com>2022-08-04 15:42:15 +0900
commitf8781453269db52ea28bfdfe1de3f60e03db1370 (patch)
tree1a1002baa5e22cd70ef5b9eaed997968b7911806 /test
parent29ec9f8128e658bc1883c2c99ce43b2d550a90ee (diff)
downloadyum-f8781453269db52ea28bfdfe1de3f60e03db1370.tar.gz
yum-f8781453269db52ea28bfdfe1de3f60e03db1370.tar.bz2
yum-f8781453269db52ea28bfdfe1de3f60e03db1370.zip
port code from python2.x to python3.x
Change-Id: Icc21ea029e40d82919e522f0ab5e99cc7a397399 Signed-off-by: biao716.wang <biao716.wang@samsung.com>
Diffstat (limited to 'test')
-rwxr-xr-xtest/check-po-yes-no.py20
-rw-r--r--test/depsolvetests.py168
-rw-r--r--test/merge-history-transactions-tests.py402
-rw-r--r--test/misc-tests.py4
-rw-r--r--test/operationstests.py18
-rw-r--r--test/packagetests.py16
-rwxr-xr-xtest/rpmdb-cache.py42
-rw-r--r--test/simpleobsoletestests.py130
-rw-r--r--test/simpleremovetests.py22
-rw-r--r--test/simpleupdatetests.py180
-rw-r--r--test/skipbroken-tests.py68
-rw-r--r--test/testbase.py10
-rw-r--r--test/transactiontests.py2
-rwxr-xr-xtest/yum-leak-test.py44
14 files changed, 563 insertions, 563 deletions
diff --git a/test/check-po-yes-no.py b/test/check-po-yes-no.py
index e22318e..85e5b68 100755
--- a/test/check-po-yes-no.py
+++ b/test/check-po-yes-no.py
@@ -10,11 +10,11 @@ from yum.misc import to_utf8
def trans(msg, default):
if msg == 'msgstr ""\n':
- return unicode(default, encoding='utf-8')
+ return str(default, encoding='utf-8')
if msg.startswith('msgstr "'):
msg = msg[len('msgstr "'):]
msg = msg[:-2]
- return unicode(msg, encoding='utf-8')
+ return str(msg, encoding='utf-8')
for fname in glob.glob("po/*.po"):
next = None
@@ -65,7 +65,7 @@ for fname in glob.glob("po/*.po"):
y is None or
no is None or
n is None):
- print >>sys.stderr, """\
+ print("""\
ERROR: Can't find all the msg id's in %s
is_this_ok %s
yes %s
@@ -77,7 +77,7 @@ n %s
yes is None,
y is None,
no is None,
- n is None)
+ n is None), file=sys.stderr)
sys.exit(1)
syes = trans(syes, "yes")
sy = trans(sy, "y")
@@ -85,7 +85,7 @@ n %s
sn = trans(sn, "n")
if (is_this_ok != yes or
is_this_ok != no):
- print >>sys.stderr, """\
+ print("""\
ERROR: yes/no translations don't match in: %s
is_this_ok %5s: %s
yes %5s: %s
@@ -95,18 +95,18 @@ n %5s: %s
""" % (fname,
to_utf8(is_this_ok), to_utf8(sis_this_ok),
to_utf8(yes), to_utf8(syes), to_utf8(y), to_utf8(sy),
- to_utf8(no), to_utf8(sno), to_utf8(n), to_utf8(sn))
+ to_utf8(no), to_utf8(sno), to_utf8(n), to_utf8(sn)), file=sys.stderr)
if syes[0] != sy:
- print >>sys.stderr, """\
+ print("""\
ERROR: yes/y translations don't match in: %s
yes %5s: %s
y %5s: %s
""" % (fname,
- yes, syes, y, sy)
+ yes, syes, y, sy), file=sys.stderr)
if sno[0] != sn:
- print >>sys.stderr, """\
+ print("""\
ERROR: no/n translations don't match in: %s
no %5s: %s
n %5s: %s
""" % (fname,
- no, sno, n, sn)
+ no, sno, n, sn), file=sys.stderr)
diff --git a/test/depsolvetests.py b/test/depsolvetests.py
index 7af3f16..ff05e58 100644
--- a/test/depsolvetests.py
+++ b/test/depsolvetests.py
@@ -9,13 +9,13 @@ class DepsolveTests(DepsolveTests):
po = FakePackage('zsh', '1', '1', None, 'i386')
self.tsInfo.addInstall(po)
self.tsInfo.remove(po.pkgtup)
- self.assertEquals('empty', *self.resolveCode())
+ self.assertEqual('empty', *self.resolveCode())
def testInstallSinglePackageNoRequires(self):
po = FakePackage('zsh', '1', '1', None, 'i386')
self.tsInfo.addInstall(po)
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((po,))
def testInstallSinglePackageRequireNotProvided(self):
@@ -23,7 +23,7 @@ class DepsolveTests(DepsolveTests):
po.addRequires('zip', None, (None, None, None))
self.tsInfo.addInstall(po)
- self.assertEquals('err', *self.resolveCode())
+ self.assertEqual('err', *self.resolveCode())
def testInstallSinglePackageRequireInstalled(self):
po = FakePackage('zsh', '1', '1', None, 'i386')
@@ -33,7 +33,7 @@ class DepsolveTests(DepsolveTests):
ipo = FakePackage('zip', '1', '1', None, 'i386')
self.rpmdb.addPackage(ipo)
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((po, ipo))
def testInstallSinglePackageRequireInstalledRequireNotProvided(self):
@@ -45,7 +45,7 @@ class DepsolveTests(DepsolveTests):
po.addRequires('zap', None, (None, None, None))
self.rpmdb.addPackage(ipo)
- self.assertEquals('err', *self.resolveCode())
+ self.assertEqual('err', *self.resolveCode())
def testInstallSinglePackageRequireInstalledRequireInstall(self):
po = FakePackage('zsh', '1', '1', None, 'i386')
@@ -58,7 +58,7 @@ class DepsolveTests(DepsolveTests):
po.addRequires('zap', None, (None, None, None))
self.rpmdb.addPackage(ipo)
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((po, po2, ipo))
@@ -70,7 +70,7 @@ class DepsolveTests(DepsolveTests):
ipo = FakePackage('zip', '1.0', '2', None, 'i386')
self.rpmdb.addPackage(ipo)
- self.assertEquals('err', *self.resolveCode())
+ self.assertEqual('err', *self.resolveCode())
def testInstallSinglePackageRequireVer1Installed(self):
po = FakePackage('zsh', '1', '1', None, 'i386')
@@ -80,7 +80,7 @@ class DepsolveTests(DepsolveTests):
ipo = FakePackage('zip', '1.3', '2', None, 'i386')
self.rpmdb.addPackage(ipo)
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((po, ipo))
def testInstallSinglePackageRequireVer2NotProvided(self):
@@ -91,7 +91,7 @@ class DepsolveTests(DepsolveTests):
ipo = FakePackage('zip', '1.3', '2', None, 'i386')
self.rpmdb.addPackage(ipo)
- self.assertEquals('err', *self.resolveCode())
+ self.assertEqual('err', *self.resolveCode())
def testInstallSinglePackageRequireVer2Installed(self):
po = FakePackage('zsh', '1', '1', None, 'i386')
@@ -101,7 +101,7 @@ class DepsolveTests(DepsolveTests):
ipo = FakePackage('zip', '1.3', '4', None, 'i386')
self.rpmdb.addPackage(ipo)
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((po, ipo))
def testInstallSinglePackageRequireVer3NotProvided(self):
@@ -112,7 +112,7 @@ class DepsolveTests(DepsolveTests):
ipo = FakePackage('zip', '1.3', '4', '0', 'i386')
self.rpmdb.addPackage(ipo)
- self.assertEquals('err', *self.resolveCode())
+ self.assertEqual('err', *self.resolveCode())
def testInstallSinglePackageRequireVer3Installed(self):
po = FakePackage('zsh', '1', '1', None, 'i386')
@@ -122,7 +122,7 @@ class DepsolveTests(DepsolveTests):
ipo = FakePackage('zip', '1.3', '4', '2', 'i386')
self.rpmdb.addPackage(ipo)
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((po, ipo))
def testInstallSinglePackageRequireVer4NotProvided(self):
@@ -133,7 +133,7 @@ class DepsolveTests(DepsolveTests):
ipo = FakePackage('zip', '1.3', '4', '2', 'i386')
self.rpmdb.addPackage(ipo)
- self.assertEquals('err', *self.resolveCode())
+ self.assertEqual('err', *self.resolveCode())
def testInstallSinglePackageRequireVer4_1Installed(self):
po = FakePackage('zsh', '1', '1', None, 'i386')
@@ -143,7 +143,7 @@ class DepsolveTests(DepsolveTests):
ipo = FakePackage('zip', '1.0', '4', '2', 'i386')
self.rpmdb.addPackage(ipo)
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((po, ipo))
def testInstallSinglePackageRequireVer4_2Installed(self):
po = FakePackage('zsh', '1', '1', None, 'i386')
@@ -153,7 +153,7 @@ class DepsolveTests(DepsolveTests):
ipo = FakePackage('zip', '1.3', '3', '2', 'i386')
self.rpmdb.addPackage(ipo)
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((po, ipo))
def testInstallSinglePackageRequireVer4_3Installed(self):
po = FakePackage('zsh', '1', '1', None, 'i386')
@@ -163,7 +163,7 @@ class DepsolveTests(DepsolveTests):
ipo = FakePackage('zip', '1.3', '4', None, 'i386')
self.rpmdb.addPackage(ipo)
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((po, ipo))
def testInstallSinglePackageRequireVer4_4Installed(self):
po = FakePackage('zsh', '1', '1', None, 'i386')
@@ -173,7 +173,7 @@ class DepsolveTests(DepsolveTests):
ipo = FakePackage('zip', '1.3', '4', '1', 'i386')
self.rpmdb.addPackage(ipo)
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((po, ipo))
def testInstallSinglePackageRequireVer4_5Installed(self):
po = FakePackage('zsh', '1', '1', None, 'i386')
@@ -183,7 +183,7 @@ class DepsolveTests(DepsolveTests):
ipo = FakePackage('zip', '0.3', '4', '2', 'i386')
self.rpmdb.addPackage(ipo)
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((po, ipo))
def testInstallSinglePackageRequireXtraBadVer(self):
@@ -198,7 +198,7 @@ class DepsolveTests(DepsolveTests):
xpo = FakePackage('zap', '1.3', '4', '0', 'i386')
self.xsack.addPackage(xpo)
- self.assertEquals('err', *self.resolveCode())
+ self.assertEqual('err', *self.resolveCode())
def testInstallSinglePackageRequireXtra(self):
po = FakePackage('zsh', '1', '1', None, 'i386')
@@ -212,7 +212,7 @@ class DepsolveTests(DepsolveTests):
xpo = FakePackage('zap', '2.6', '8', '4', 'i386')
self.xsack.addPackage(xpo)
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((po, ipo, xpo))
def testInstallSinglePackageRequireInstalledRequireXtra(self):
@@ -227,7 +227,7 @@ class DepsolveTests(DepsolveTests):
xpo = FakePackage('zap', '2.6', '8', '4', 'i386')
self.xsack.addPackage(xpo)
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((po, ipo))
def testInstallSinglePackageRequireUpgradeRequireXtraErr(self):
@@ -246,7 +246,7 @@ class DepsolveTests(DepsolveTests):
xpo.addRequires('zsh', 'EQ', ('2', '4', '8'))
self.xsack.addPackage(xpo)
- self.assertEquals('err', *self.resolveCode())
+ self.assertEqual('err', *self.resolveCode())
def testInstallSinglePackageRequireUpgradeRequireXtraOk(self):
po = FakePackage('zsh', '1', '1', None, 'i386')
@@ -263,7 +263,7 @@ class DepsolveTests(DepsolveTests):
xpo2 = FakePackage('zap', '1.3', '4', '2', 'i386')
self.xsack.addPackage(xpo2)
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((po, xpo, xpo2))
def testInstallSinglePackageRequireMultiXtra(self):
@@ -278,7 +278,7 @@ class DepsolveTests(DepsolveTests):
xpo2 = FakePackage('zap', '1.3', '4', '2', 'i386')
self.xsack.addPackage(xpo2)
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((po, xpo, xpo2))
def testInstallSinglePackageRequireInstalledMultiLib(self):
@@ -292,7 +292,7 @@ class DepsolveTests(DepsolveTests):
xpo = FakePackage('zip', '1', '3', None, 'x86_64')
self.xsack.addPackage(xpo)
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((po, ipo))
def testInstallSinglePackageRequireXtra1MultiLib(self):
@@ -302,7 +302,7 @@ class DepsolveTests(DepsolveTests):
xpo = FakePackage('zip', '1', '3', None, 'i386')
self.xsack.addPackage(xpo)
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((po, xpo))
def testInstallSinglePackageRequireXtra2_64MultiLib(self):
@@ -315,7 +315,7 @@ class DepsolveTests(DepsolveTests):
xpo64 = FakePackage('zip', '1', '3', None, 'x86_64')
self.xsack.addPackage(xpo64)
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((po, xpo64))
def testInstallSinglePackageRequireXtra2_32MultiLib(self):
@@ -328,7 +328,7 @@ class DepsolveTests(DepsolveTests):
xpo64 = FakePackage('zip', '1', '3', None, 'x86_64')
self.xsack.addPackage(xpo64)
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((po, xpo64))
def testUpdateSinglePackage(self):
@@ -338,7 +338,7 @@ class DepsolveTests(DepsolveTests):
po = FakePackage('zsh', '1', '3', None, 'i386')
self.tsInfo.addUpdate(po, oldpo=ipo)
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((po,))
def testUpdateForDependency(self):
@@ -352,7 +352,7 @@ class DepsolveTests(DepsolveTests):
updatepo = FakePackage('zip', '2', '1', '0', 'i386')
self.xsack.addPackage(updatepo)
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((po, updatepo))
def testUpdateSplitPackage(self):
@@ -371,7 +371,7 @@ class DepsolveTests(DepsolveTests):
updatepo2.addProvides('libzip', 'EQ', ('0', '2', '1'))
self.xsack.addPackage(updatepo2)
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
#self.assertResult((po, updatepo, updatepo2)) # XXX obsolete needed?
self.assertResult((po, installedpo, updatepo2))
@@ -386,7 +386,7 @@ class DepsolveTests(DepsolveTests):
xpo = FakePackage('zip', '1', '3', None, 'x86_64')
self.xsack.addPackage(xpo)
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((po, xpo))
def testUpdateSinglePackageOldRequires(self):
@@ -401,7 +401,7 @@ class DepsolveTests(DepsolveTests):
po.addRequires('zip', None, (None, None, None))
self.tsInfo.addUpdate(po, oldpo=ipo)
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((po, xpo))
def testUpdateSinglePackageOldRequiresGone(self):
@@ -415,7 +415,7 @@ class DepsolveTests(DepsolveTests):
po = FakePackage('zsh', '1', '3', None, 'i386')
self.tsInfo.addUpdate(po, oldpo=ipo)
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((po, xpo))
def testUpdateSinglePackageObsoletesOldRequirement(self):
@@ -434,7 +434,7 @@ class DepsolveTests(DepsolveTests):
self.tsInfo.addObsoleting(po, opo)
self.tsInfo.addObsoleted(opo, po)
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((po,))
def testUpdateForConflict(self):
@@ -448,7 +448,7 @@ class DepsolveTests(DepsolveTests):
updatepo = FakePackage('zip', '2', '1', '0', 'i386')
self.xsack.addPackage(updatepo)
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((po, updatepo))
def testUpdateForConflict2(self):
@@ -462,7 +462,7 @@ class DepsolveTests(DepsolveTests):
updatepo = FakePackage('zip', '2', '1', '0', 'i386')
self.xsack.addPackage(updatepo)
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((po, updatepo))
def testUpdateForConflictProvide(self):
@@ -477,7 +477,7 @@ class DepsolveTests(DepsolveTests):
updatepo = FakePackage('zip', '2', '1', '0', 'i386')
self.xsack.addPackage(updatepo)
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((po, updatepo))
def testUpdateForConflictProvide2(self):
@@ -495,7 +495,7 @@ class DepsolveTests(DepsolveTests):
updatepo.addConflicts('zippy', 'LT', ('0', '2', '1'))
self.xsack.addPackage(updatepo)
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((po, updatepo))
def testEraseSinglePackage(self):
@@ -503,7 +503,7 @@ class DepsolveTests(DepsolveTests):
self.rpmdb.addPackage(po)
self.tsInfo.addErase(po)
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult(())
def testEraseSinglePackageRequiredByOneInstalled(self):
@@ -515,7 +515,7 @@ class DepsolveTests(DepsolveTests):
self.rpmdb.addPackage(po)
self.tsInfo.addErase(po)
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult(())
def _setup_FakeMultilibReqs(self):
@@ -550,14 +550,14 @@ class DepsolveTests(DepsolveTests):
def testFakeMultilibReqsInstall(self):
(po, xpo1, xpo2, ipo1, ipo2) = self._setup_FakeMultilibReqs()
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((po, xpo2, ipo2))
def testFakeMultilibReqsUpdate1a(self):
(po, xpo1, xpo2, ipo1, ipo2) = self._setup_FakeMultilibReqs()
self.rpmdb.addPackage(xpo1)
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((po, xpo2, ipo2))
def testFakeMultilibReqsUpdate1b(self):
@@ -568,14 +568,14 @@ class DepsolveTests(DepsolveTests):
# wins.
po.addRequires('libxyz-1.so.0(XYZ_1.1)', None, (None, None, None))
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((po, xpo2, ipo2))
def testFakeMultilibReqsUpdate2(self):
(po, xpo1, xpo2, ipo1, ipo2) = self._setup_FakeMultilibReqs()
self.rpmdb.addPackage(ipo1)
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((po, xpo2, ipo2))
def testFakeMultilibReqsUpdate3(self):
@@ -583,7 +583,7 @@ class DepsolveTests(DepsolveTests):
self.rpmdb.addPackage(xpo1)
self.rpmdb.addPackage(ipo1)
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((po, xpo2, ipo2))
def _setup_CompareProviders(self, name="libbar", arch="x86_64"):
@@ -602,13 +602,13 @@ class DepsolveTests(DepsolveTests):
def testCompareProvidersSameLen1_64(self):
(po, po1, po2) = self._setup_CompareProviders()
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((po, po1))
def testCompareProvidersSameLen1_noarch(self):
(po, po1, po2) = self._setup_CompareProviders(arch='noarch')
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((po,), (po1,po2))
def testCompareProvidersSameLen2_64(self):
@@ -624,7 +624,7 @@ class DepsolveTests(DepsolveTests):
po1.addProvides('libxyz-1.so.0(64bit)', None,(None,None,None))
self.xsack.addPackage(po1)
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((po, po1))
def testCompareProvidersSameLen2_noarch(self):
@@ -640,7 +640,7 @@ class DepsolveTests(DepsolveTests):
po1.addProvides('libxyz-1.so.0', None,(None,None,None))
self.xsack.addPackage(po1)
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((po,), (po1,po2))
def testCompareProvidersSameLen2_noarch_to_64_1(self):
@@ -657,7 +657,7 @@ class DepsolveTests(DepsolveTests):
po1.addProvides('libxyz-1.so.0', None,(None,None,None))
self.xsack.addPackage(po1)
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((po, po1))
@@ -675,21 +675,21 @@ class DepsolveTests(DepsolveTests):
po1.addProvides('libxyz-1.so.0', None,(None,None,None))
self.xsack.addPackage(po1)
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((po, po2))
def testCompareProvidersDiffLen_64(self):
(po, po1, po2) = self._setup_CompareProviders(name='libbarf')
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((po, po1))
def testCompareProvidersDiffLen_noarch(self):
(po, po1, po2) = self._setup_CompareProviders(name='libbarf',
arch='noarch')
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((po, po1))
def testCompareProvidersSrcRpm_64(self):
@@ -697,7 +697,7 @@ class DepsolveTests(DepsolveTests):
po.sourcerpm = "abcd.src.rpm"
po2.sourcerpm = "abcd.src.rpm"
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((po, po2))
def testCompareProvidersSrcRpm_noarch(self):
@@ -706,20 +706,20 @@ class DepsolveTests(DepsolveTests):
po.sourcerpm = "abcd.src.rpm"
po2.sourcerpm = "abcd.src.rpm"
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((po, po2))
def testCompareProvidersPrefix_64(self):
(po, po1, po2) = self._setup_CompareProviders(name='abcd-libbarf')
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((po, po2))
def testCompareProvidersPrefix_noarch(self):
(po, po1, po2) = self._setup_CompareProviders(name='abcd-libbarf',
arch='noarch')
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((po, po2))
def testCompareProvidersArchVSLen(self):
@@ -737,7 +737,7 @@ class DepsolveTests(DepsolveTests):
self.xsack.addPackage(po2)
self.xsack.addPackage(po3)
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((po, po1))
def testSelfObsInstall(self):
@@ -746,7 +746,7 @@ class DepsolveTests(DepsolveTests):
xpo.addProvides('abcd-Foo', None, (None, None, None))
self.tsInfo.addInstall(xpo)
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((xpo,))
def testSelfObsUpgrade(self):
@@ -760,7 +760,7 @@ class DepsolveTests(DepsolveTests):
xpo.addProvides('abcd-Foo', None, (None, None, None))
self.tsInfo.addUpdate(xpo, oldpo=ipo)
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((xpo,))
@@ -782,7 +782,7 @@ class DepsolveTests(DepsolveTests):
po3 = FakePackage('Foo', version='3', arch='noarch')
self.xsack.addPackage(po3)
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((xpo, po3))
def testMultiPkgVersions2(self):
@@ -803,7 +803,7 @@ class DepsolveTests(DepsolveTests):
po3 = FakePackage('Foo', version='2', arch='i586')
self.xsack.addPackage(po3)
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((xpo, po3))
def testMultiPkgVersions3(self):
@@ -824,7 +824,7 @@ class DepsolveTests(DepsolveTests):
po3 = FakePackage('Foo', version='2', arch='i586')
self.xsack.addPackage(po3)
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((xpo, po2))
def testMultiPkgVersions4(self):
@@ -845,7 +845,7 @@ class DepsolveTests(DepsolveTests):
po3 = FakePackage('Foo', version='2', arch='i386')
self.xsack.addPackage(po3)
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((xpo, po2))
def testMultiPkgVersions5(self):
@@ -866,7 +866,7 @@ class DepsolveTests(DepsolveTests):
self.xsack.addPackage(po3)
self.xsack.addPackage(po2)
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((xpo, po2))
# Test from "Real Life" because we just can't think like they do
@@ -884,7 +884,7 @@ class DepsolveTests(DepsolveTests):
po2.addObsoletes('unison', 'LT', ('0', '2.27.57', '3'))
self.xsack.addPackage(po2)
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((xpo, po2))
def testRL_unison2(self):
@@ -901,7 +901,7 @@ class DepsolveTests(DepsolveTests):
self.xsack.addPackage(po2)
self.xsack.addPackage(po1)
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((xpo, po2))
def test_min_inst_and_dep(self):
@@ -921,7 +921,7 @@ class DepsolveTests(DepsolveTests):
po4 = FakePackage('bar', version='4')
self.xsack.addPackage(po4)
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((ipo2, po4))
def test_min_up_and_dep1(self):
@@ -944,7 +944,7 @@ class DepsolveTests(DepsolveTests):
po4 = FakePackage('bar', version='4')
self.xsack.addPackage(po4)
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((ipo2, po4))
def test_min_up_and_dep2(self):
@@ -967,7 +967,7 @@ class DepsolveTests(DepsolveTests):
self.xsack.addPackage(po2)
self.xsack.addPackage(po1)
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((ipo2, po4))
def test_min_up_and_dep3(self):
@@ -1006,7 +1006,7 @@ class DepsolveTests(DepsolveTests):
po7.addRequires('bar', 'EQ', ('0', '4', '1'))
self.xsack.addPackage(po7)
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((ipo3, po4, po7))
def test_multi_inst_dep1(self):
@@ -1024,7 +1024,7 @@ class DepsolveTests(DepsolveTests):
po2.addProvides('bar-prov2', 'EQ', ('0', '2', '0'))
self.xsack.addPackage(po2)
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((ipo1, po1))
def test_multi_inst_dep2(self):
@@ -1042,7 +1042,7 @@ class DepsolveTests(DepsolveTests):
self.xsack.addPackage(po2)
self.xsack.addPackage(po1)
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((ipo1, po1))
def test_multi_inst_dep3(self):
@@ -1059,7 +1059,7 @@ class DepsolveTests(DepsolveTests):
po2.addProvides('libbar-prov1.so.0()', None, (None, None, None))
self.xsack.addPackage(po2)
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((ipo1, po1))
def test_multi_inst_dep4(self):
@@ -1076,7 +1076,7 @@ class DepsolveTests(DepsolveTests):
po2.addProvides('libbar-prov1.so.0()', None, (None, None, None))
self.xsack.addPackage(po2)
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((ipo1, po1))
def test_multi_inst_dep5(self):
@@ -1093,7 +1093,7 @@ class DepsolveTests(DepsolveTests):
self.xsack.addPackage(po2)
self.xsack.addPackage(po1)
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((ipo1, po1))
def test_inst_require_conflict1(self):
@@ -1105,7 +1105,7 @@ class DepsolveTests(DepsolveTests):
po1 = FakePackage('bar')
self.xsack.addPackage(po1)
- self.assertEquals('err', *self.resolveCode())
+ self.assertEqual('err', *self.resolveCode())
def test_inst_require_conflict_me1(self):
ipo1 = FakePackage('foo')
@@ -1116,7 +1116,7 @@ class DepsolveTests(DepsolveTests):
po1.addConflicts('foo', None, (None, None, None))
self.xsack.addPackage(po1)
- self.assertEquals('err', *self.resolveCode())
+ self.assertEqual('err', *self.resolveCode())
def test_inst_require_obsoletes1(self):
ipo1 = FakePackage('foo')
@@ -1131,7 +1131,7 @@ class DepsolveTests(DepsolveTests):
# don't ignore the conflicts above? ... I'm guessing ignoring it is
# by accident too? bah.
# self.assertEquals('err', *self.resolveCode())
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((ipo1, po1))
def testUpdate_so_req_diff_arch(self):
@@ -1155,7 +1155,7 @@ class DepsolveTests(DepsolveTests):
self.tsInfo.addUpdate(apo2, oldpo=rpo2)
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((apo1, apo2))
def testInstalllib_oldbad_prov1(self):
@@ -1175,7 +1175,7 @@ class DepsolveTests(DepsolveTests):
ipo1.addRequires('libfoo.so.2()', None, (None, None, None))
self.tsInfo.addInstall(ipo1)
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((ipo1, apo3))
def testCompareProvidersNoarchWithHigherVer_to_64(self):
@@ -1194,7 +1194,7 @@ class DepsolveTests(DepsolveTests):
po1.addProvides('libxyz-1.so.0', None,(None,None,None))
self.xsack.addPackage(po1)
- self.assertEquals('ok', *self.resolveCode())
+ self.assertEqual('ok', *self.resolveCode())
self.assertResult((po, po2))
def testRL_dcbd1(self):
@@ -1211,4 +1211,4 @@ class DepsolveTests(DepsolveTests):
self.xsack.addPackage(po2)
self.xsack.addPackage(po1)
- self.assertEquals('err', *self.resolveCode())
+ self.assertEqual('err', *self.resolveCode())
diff --git a/test/merge-history-transactions-tests.py b/test/merge-history-transactions-tests.py
index 569ba8d..f6464c7 100644
--- a/test/merge-history-transactions-tests.py
+++ b/test/merge-history-transactions-tests.py
@@ -76,12 +76,12 @@ class MergeHistTransTests(unittest.TestCase):
def assertMergedBeg(self, merged, beg):
self.assertTrue(beg.tid in merged.tid)
- self.assertEquals(beg.beg_timestamp, merged.beg_timestamp)
- self.assertEquals(beg.beg_rpmdbversion, merged.beg_rpmdbversion)
+ self.assertEqual(beg.beg_timestamp, merged.beg_timestamp)
+ self.assertEqual(beg.beg_rpmdbversion, merged.beg_rpmdbversion)
def assertMergedEnd(self, merged, end):
self.assertTrue(end.tid in merged.tid)
- self.assertEquals(end.end_timestamp, merged.end_timestamp)
- self.assertEquals(end.end_rpmdbversion, merged.end_rpmdbversion)
+ self.assertEqual(end.end_timestamp, merged.end_timestamp)
+ self.assertEqual(end.end_rpmdbversion, merged.end_rpmdbversion)
def assertMergedCodes(self, merged, trans):
ret = set()
uid = set()
@@ -89,12 +89,12 @@ class MergeHistTransTests(unittest.TestCase):
ret.add(trans.loginuid)
uid.add(trans.return_code)
if len(ret) == 1:
- self.assertEquals(list(ret)[0], merged.return_code)
+ self.assertEqual(list(ret)[0], merged.return_code)
else:
for ret in ret:
self.assertTrue(ret in merged.return_code)
if len(uid) == 1:
- self.assertEquals(list(uid)[0], merged.loginuid)
+ self.assertEqual(list(uid)[0], merged.loginuid)
else:
for uid in uid:
self.assertTrue(uid in merged.loginuid)
@@ -113,11 +113,11 @@ class MergeHistTransTests(unittest.TestCase):
merged = self._merge_new(trans)
self.assertMergedMain(merged, trans)
pkgs = merged.trans_data
- self.assertEquals(len(pkgs), 2)
- self.assertEquals(pkgs[0], pkg1)
- self.assertEquals(pkgs[0].state, xstate)
- self.assertEquals(pkgs[1], pkg2)
- self.assertEquals(pkgs[1].state, pkg2.state)
+ self.assertEqual(len(pkgs), 2)
+ self.assertEqual(pkgs[0], pkg1)
+ self.assertEqual(pkgs[0].state, xstate)
+ self.assertEqual(pkgs[1], pkg2)
+ self.assertEqual(pkgs[1].state, pkg2.state)
def testSimpleInMerge2(self, xstate='Install'):
pkg1 = self._pkg_new('foo', state=xstate)
@@ -130,15 +130,15 @@ class MergeHistTransTests(unittest.TestCase):
merged = self._merge_new(trans)
self.assertMergedMain(merged, trans)
pkgs = merged.trans_data
- self.assertEquals(len(pkgs), 4)
- self.assertEquals(pkgs[0], pkg2)
- self.assertEquals(pkgs[0].state, pkg2.state)
- self.assertEquals(pkgs[1], pkg1)
- self.assertEquals(pkgs[1].state, xstate)
- self.assertEquals(pkgs[2], pkg3)
- self.assertEquals(pkgs[2].state, pkg3.state)
- self.assertEquals(pkgs[3], pkg4)
- self.assertEquals(pkgs[3].state, pkg4.state)
+ self.assertEqual(len(pkgs), 4)
+ self.assertEqual(pkgs[0], pkg2)
+ self.assertEqual(pkgs[0].state, pkg2.state)
+ self.assertEqual(pkgs[1], pkg1)
+ self.assertEqual(pkgs[1].state, xstate)
+ self.assertEqual(pkgs[2], pkg3)
+ self.assertEqual(pkgs[2].state, pkg3.state)
+ self.assertEqual(pkgs[3], pkg4)
+ self.assertEqual(pkgs[3].state, pkg4.state)
def testSimpleUpMerge1(self, xstate='Update'):
opkg1 = self._pkg_new('foo', state='Updated')
@@ -152,15 +152,15 @@ class MergeHistTransTests(unittest.TestCase):
merged = self._merge_new(trans)
self.assertMergedMain(merged, trans)
pkgs = merged.trans_data
- self.assertEquals(len(pkgs), 4)
- self.assertEquals(pkgs[0], opkg2)
- self.assertEquals(pkgs[0].state, opkg2.state)
- self.assertEquals(pkgs[1], npkg2)
- self.assertEquals(pkgs[1].state, npkg2.state)
- self.assertEquals(pkgs[2], opkg1)
- self.assertEquals(pkgs[2].state, opkg1.state)
- self.assertEquals(pkgs[3], npkg1)
- self.assertEquals(pkgs[3].state, xstate)
+ self.assertEqual(len(pkgs), 4)
+ self.assertEqual(pkgs[0], opkg2)
+ self.assertEqual(pkgs[0].state, opkg2.state)
+ self.assertEqual(pkgs[1], npkg2)
+ self.assertEqual(pkgs[1].state, npkg2.state)
+ self.assertEqual(pkgs[2], opkg1)
+ self.assertEqual(pkgs[2].state, opkg1.state)
+ self.assertEqual(pkgs[3], npkg1)
+ self.assertEqual(pkgs[3].state, xstate)
def testSimpleUpMerge2(self, xstate='Update'):
opkg1 = self._pkg_new('foo', state='Updated')
@@ -176,15 +176,15 @@ class MergeHistTransTests(unittest.TestCase):
merged = self._merge_new(trans)
self.assertMergedMain(merged, trans)
pkgs = merged.trans_data
- self.assertEquals(len(pkgs), 4)
- self.assertEquals(pkgs[0], opkg2)
- self.assertEquals(pkgs[0].state, opkg2.state)
- self.assertEquals(pkgs[1], npkg2)
- self.assertEquals(pkgs[1].state, npkg2.state)
- self.assertEquals(pkgs[2], opkg1)
- self.assertEquals(pkgs[2].state, opkg1.state)
- self.assertEquals(pkgs[3], npkg3)
- self.assertEquals(pkgs[3].state, xstate)
+ self.assertEqual(len(pkgs), 4)
+ self.assertEqual(pkgs[0], opkg2)
+ self.assertEqual(pkgs[0].state, opkg2.state)
+ self.assertEqual(pkgs[1], npkg2)
+ self.assertEqual(pkgs[1].state, npkg2.state)
+ self.assertEqual(pkgs[2], opkg1)
+ self.assertEqual(pkgs[2].state, opkg1.state)
+ self.assertEqual(pkgs[3], npkg3)
+ self.assertEqual(pkgs[3].state, xstate)
def testSimpleUpMerge3(self, xstate='Install'):
opkg1 = self._pkg_new('foo', state=xstate)
@@ -199,13 +199,13 @@ class MergeHistTransTests(unittest.TestCase):
merged = self._merge_new(trans)
self.assertMergedMain(merged, trans)
pkgs = merged.trans_data
- self.assertEquals(len(pkgs), 3)
- self.assertEquals(pkgs[0], opkg2)
- self.assertEquals(pkgs[0].state, opkg2.state)
- self.assertEquals(pkgs[1], npkg2)
- self.assertEquals(pkgs[1].state, npkg2.state)
- self.assertEquals(pkgs[2], npkg3)
- self.assertEquals(pkgs[2].state, xstate)
+ self.assertEqual(len(pkgs), 3)
+ self.assertEqual(pkgs[0], opkg2)
+ self.assertEqual(pkgs[0].state, opkg2.state)
+ self.assertEqual(pkgs[1], npkg2)
+ self.assertEqual(pkgs[1].state, npkg2.state)
+ self.assertEqual(pkgs[2], npkg3)
+ self.assertEqual(pkgs[2].state, xstate)
def testSimpleUpMultiMerge1(self, xstate='Install'):
opkg1 = self._pkg_new('foo', arch='i586', state=xstate)
@@ -220,13 +220,13 @@ class MergeHistTransTests(unittest.TestCase):
merged = self._merge_new(trans)
self.assertMergedMain(merged, trans)
pkgs = merged.trans_data
- self.assertEquals(len(pkgs), 3)
- self.assertEquals(pkgs[0], opkg2)
- self.assertEquals(pkgs[0].state, opkg2.state)
- self.assertEquals(pkgs[1], npkg2)
- self.assertEquals(pkgs[1].state, npkg2.state)
- self.assertEquals(pkgs[2], npkg3)
- self.assertEquals(pkgs[2].state, xstate)
+ self.assertEqual(len(pkgs), 3)
+ self.assertEqual(pkgs[0], opkg2)
+ self.assertEqual(pkgs[0].state, opkg2.state)
+ self.assertEqual(pkgs[1], npkg2)
+ self.assertEqual(pkgs[1].state, npkg2.state)
+ self.assertEqual(pkgs[2], npkg3)
+ self.assertEqual(pkgs[2].state, xstate)
def testUpDownMerge1(self, xstate='Update'):
opkg1 = self._pkg_new('foo', version='0', state='Updated')
@@ -245,16 +245,16 @@ class MergeHistTransTests(unittest.TestCase):
merged = self._merge_new(trans)
self.assertMergedMain(merged, trans)
pkgs = merged.trans_data
- self.assertEquals(len(pkgs), 4)
- self.assertEquals(pkgs[0], opkg2)
- self.assertEquals(pkgs[1], npkg2)
- self.assertEquals(pkgs[2], opkg1)
- self.assertNotEquals(pkgs[3], opkg3)
- self.assertNotEquals(pkgs[3], npkg3)
- self.assertNotEquals(pkgs[3], opkg4)
- self.assertNotEquals(pkgs[3].state, npkg4.state)
- self.assertEquals(pkgs[3].pkgtup, npkg4.pkgtup)
- self.assertEquals(pkgs[3].state, xstate)
+ self.assertEqual(len(pkgs), 4)
+ self.assertEqual(pkgs[0], opkg2)
+ self.assertEqual(pkgs[1], npkg2)
+ self.assertEqual(pkgs[2], opkg1)
+ self.assertNotEqual(pkgs[3], opkg3)
+ self.assertNotEqual(pkgs[3], npkg3)
+ self.assertNotEqual(pkgs[3], opkg4)
+ self.assertNotEqual(pkgs[3].state, npkg4.state)
+ self.assertEqual(pkgs[3].pkgtup, npkg4.pkgtup)
+ self.assertEqual(pkgs[3].state, xstate)
def testUpDownMerge2(self, xstate='Install'):
opkg1 = self._pkg_new('foo')
@@ -272,16 +272,16 @@ class MergeHistTransTests(unittest.TestCase):
merged = self._merge_new(trans)
self.assertMergedMain(merged, trans)
pkgs = merged.trans_data
- self.assertEquals(len(pkgs), 3)
- self.assertEquals(pkgs[0], opkg2)
- self.assertEquals(pkgs[1], npkg2)
- self.assertNotEquals(pkgs[2], opkg1)
- self.assertNotEquals(pkgs[2], opkg3)
- self.assertNotEquals(pkgs[2], npkg3)
- self.assertNotEquals(pkgs[2], opkg4)
- self.assertNotEquals(pkgs[2].state, npkg4.state)
- self.assertEquals(pkgs[2].pkgtup, npkg4.pkgtup)
- self.assertEquals(pkgs[2].state, xstate)
+ self.assertEqual(len(pkgs), 3)
+ self.assertEqual(pkgs[0], opkg2)
+ self.assertEqual(pkgs[1], npkg2)
+ self.assertNotEqual(pkgs[2], opkg1)
+ self.assertNotEqual(pkgs[2], opkg3)
+ self.assertNotEqual(pkgs[2], npkg3)
+ self.assertNotEqual(pkgs[2], opkg4)
+ self.assertNotEqual(pkgs[2].state, npkg4.state)
+ self.assertEqual(pkgs[2].pkgtup, npkg4.pkgtup)
+ self.assertEqual(pkgs[2].state, xstate)
def testUpDownMerge3(self):
opkg1 = self._pkg_new('foo')
@@ -299,18 +299,18 @@ class MergeHistTransTests(unittest.TestCase):
merged = self._merge_new(trans)
self.assertMergedMain(merged, trans)
pkgs = merged.trans_data
- self.assertEquals(len(pkgs), 4)
- self.assertEquals(pkgs[0], opkg2)
- self.assertEquals(pkgs[1], npkg2)
- self.assertEquals(pkgs[2], opkg1)
- self.assertEquals(pkgs[2].state, opkg1.state)
- self.assertNotEquals(pkgs[3], opkg1)
- self.assertNotEquals(pkgs[3].state, opkg3.state)
- self.assertNotEquals(pkgs[3], npkg3)
- self.assertNotEquals(pkgs[3], opkg4)
- self.assertNotEquals(pkgs[3].state, npkg4.state)
- self.assertEquals(pkgs[3].pkgtup, npkg4.pkgtup)
- self.assertEquals(pkgs[3].state, 'Reinstall')
+ self.assertEqual(len(pkgs), 4)
+ self.assertEqual(pkgs[0], opkg2)
+ self.assertEqual(pkgs[1], npkg2)
+ self.assertEqual(pkgs[2], opkg1)
+ self.assertEqual(pkgs[2].state, opkg1.state)
+ self.assertNotEqual(pkgs[3], opkg1)
+ self.assertNotEqual(pkgs[3].state, opkg3.state)
+ self.assertNotEqual(pkgs[3], npkg3)
+ self.assertNotEqual(pkgs[3], opkg4)
+ self.assertNotEqual(pkgs[3].state, npkg4.state)
+ self.assertEqual(pkgs[3].pkgtup, npkg4.pkgtup)
+ self.assertEqual(pkgs[3].state, 'Reinstall')
def testUpDownMerge4(self, xstate='Update'):
opkg2 = self._pkg_new('bar', version='4', state='Updated')
@@ -327,18 +327,18 @@ class MergeHistTransTests(unittest.TestCase):
merged = self._merge_new(trans)
self.assertMergedMain(merged, trans)
pkgs = merged.trans_data
- self.assertEquals(len(pkgs), 3)
- self.assertEquals(pkgs[0], opkg2)
- self.assertEquals(pkgs[1], npkg2)
- self.assertNotEquals(pkgs[2].state, opkg3.state)
- self.assertNotEquals(pkgs[2], npkg3)
- self.assertNotEquals(pkgs[2], opkg4)
- self.assertNotEquals(pkgs[2].state, npkg4.state)
- self.assertEquals(pkgs[2].pkgtup, opkg3.pkgtup)
+ self.assertEqual(len(pkgs), 3)
+ self.assertEqual(pkgs[0], opkg2)
+ self.assertEqual(pkgs[1], npkg2)
+ self.assertNotEqual(pkgs[2].state, opkg3.state)
+ self.assertNotEqual(pkgs[2], npkg3)
+ self.assertNotEqual(pkgs[2], opkg4)
+ self.assertNotEqual(pkgs[2].state, npkg4.state)
+ self.assertEqual(pkgs[2].pkgtup, opkg3.pkgtup)
if xstate == 'Obsoleting':
- self.assertEquals(pkgs[2].state, 'Obsoleting')
+ self.assertEqual(pkgs[2].state, 'Obsoleting')
else:
- self.assertEquals(pkgs[2].state, 'Reinstall')
+ self.assertEqual(pkgs[2].state, 'Reinstall')
def testUpDownMerge5(self, xstate='Update'):
opkg2 = self._pkg_new('bar', version='4', state='Updated')
@@ -358,15 +358,15 @@ class MergeHistTransTests(unittest.TestCase):
merged = self._merge_new(trans)
self.assertMergedMain(merged, trans)
pkgs = merged.trans_data
- self.assertEquals(len(pkgs), 4)
- self.assertEquals(pkgs[0], opkg2)
- self.assertEquals(pkgs[0].state, opkg2.state)
- self.assertEquals(pkgs[1], npkg2)
- self.assertEquals(pkgs[1].state, npkg2.state)
- self.assertEquals(pkgs[2], opkg3)
- self.assertEquals(pkgs[2].state, opkg3.state)
- self.assertEquals(pkgs[3], npkg5)
- self.assertEquals(pkgs[3].state, xstate)
+ self.assertEqual(len(pkgs), 4)
+ self.assertEqual(pkgs[0], opkg2)
+ self.assertEqual(pkgs[0].state, opkg2.state)
+ self.assertEqual(pkgs[1], npkg2)
+ self.assertEqual(pkgs[1].state, npkg2.state)
+ self.assertEqual(pkgs[2], opkg3)
+ self.assertEqual(pkgs[2].state, opkg3.state)
+ self.assertEqual(pkgs[3], npkg5)
+ self.assertEqual(pkgs[3].state, xstate)
def testDownUpMerge1(self, xstate='Downgrade'):
opkg1 = self._pkg_new('foo', version='10', state='Downgraded')
@@ -385,17 +385,17 @@ class MergeHistTransTests(unittest.TestCase):
merged = self._merge_new(trans)
self.assertMergedMain(merged, trans)
pkgs = merged.trans_data
- self.assertEquals(len(pkgs), 4)
- self.assertEquals(pkgs[0], opkg2)
- self.assertEquals(pkgs[1], npkg2)
- self.assertNotEquals(pkgs[2], opkg3)
- self.assertNotEquals(pkgs[2].state, npkg3.state)
- self.assertNotEquals(pkgs[2], opkg4)
- self.assertNotEquals(pkgs[2], npkg4)
- self.assertEquals(pkgs[2].pkgtup, npkg3.pkgtup)
- self.assertEquals(pkgs[2].state, xstate)
- self.assertEquals(pkgs[3], opkg1)
- self.assertEquals(pkgs[3].state, opkg1.state)
+ self.assertEqual(len(pkgs), 4)
+ self.assertEqual(pkgs[0], opkg2)
+ self.assertEqual(pkgs[1], npkg2)
+ self.assertNotEqual(pkgs[2], opkg3)
+ self.assertNotEqual(pkgs[2].state, npkg3.state)
+ self.assertNotEqual(pkgs[2], opkg4)
+ self.assertNotEqual(pkgs[2], npkg4)
+ self.assertEqual(pkgs[2].pkgtup, npkg3.pkgtup)
+ self.assertEqual(pkgs[2].state, xstate)
+ self.assertEqual(pkgs[3], opkg1)
+ self.assertEqual(pkgs[3].state, opkg1.state)
def testDownUpMerge2(self, xstate='Install'):
opkg1 = self._pkg_new('foo', version='7', state=xstate)
@@ -413,16 +413,16 @@ class MergeHistTransTests(unittest.TestCase):
merged = self._merge_new(trans)
self.assertMergedMain(merged, trans)
pkgs = merged.trans_data
- self.assertEquals(len(pkgs), 3)
- self.assertEquals(pkgs[0], opkg2)
- self.assertEquals(pkgs[1], npkg2)
- self.assertNotEquals(pkgs[2], opkg1)
- self.assertNotEquals(pkgs[2], opkg3)
- self.assertNotEquals(pkgs[2], opkg4)
- self.assertNotEquals(pkgs[2], npkg4)
- self.assertNotEquals(pkgs[2].state, npkg3.state)
- self.assertEquals(pkgs[2].pkgtup, npkg3.pkgtup)
- self.assertEquals(pkgs[2].state, xstate)
+ self.assertEqual(len(pkgs), 3)
+ self.assertEqual(pkgs[0], opkg2)
+ self.assertEqual(pkgs[1], npkg2)
+ self.assertNotEqual(pkgs[2], opkg1)
+ self.assertNotEqual(pkgs[2], opkg3)
+ self.assertNotEqual(pkgs[2], opkg4)
+ self.assertNotEqual(pkgs[2], npkg4)
+ self.assertNotEqual(pkgs[2].state, npkg3.state)
+ self.assertEqual(pkgs[2].pkgtup, npkg3.pkgtup)
+ self.assertEqual(pkgs[2].state, xstate)
def testDownUpMerge3(self):
opkg1 = self._pkg_new('foo')
@@ -440,18 +440,18 @@ class MergeHistTransTests(unittest.TestCase):
merged = self._merge_new(trans)
self.assertMergedMain(merged, trans)
pkgs = merged.trans_data
- self.assertEquals(len(pkgs), 4)
- self.assertEquals(pkgs[0], opkg2)
- self.assertEquals(pkgs[1], npkg2)
- self.assertEquals(pkgs[2], opkg1)
- self.assertEquals(pkgs[2].state, opkg1.state)
- self.assertNotEquals(pkgs[3], opkg1)
- self.assertNotEquals(pkgs[3], opkg3)
- self.assertNotEquals(pkgs[3].state, npkg3.state)
- self.assertNotEquals(pkgs[3].state, opkg4.state)
- self.assertNotEquals(pkgs[3], npkg4)
- self.assertEquals(pkgs[3].pkgtup, npkg3.pkgtup)
- self.assertEquals(pkgs[3].state, 'Reinstall')
+ self.assertEqual(len(pkgs), 4)
+ self.assertEqual(pkgs[0], opkg2)
+ self.assertEqual(pkgs[1], npkg2)
+ self.assertEqual(pkgs[2], opkg1)
+ self.assertEqual(pkgs[2].state, opkg1.state)
+ self.assertNotEqual(pkgs[3], opkg1)
+ self.assertNotEqual(pkgs[3], opkg3)
+ self.assertNotEqual(pkgs[3].state, npkg3.state)
+ self.assertNotEqual(pkgs[3].state, opkg4.state)
+ self.assertNotEqual(pkgs[3], npkg4)
+ self.assertEqual(pkgs[3].pkgtup, npkg3.pkgtup)
+ self.assertEqual(pkgs[3].state, 'Reinstall')
def testDownUpMerge4(self, xstate='Update'):
opkg2 = self._pkg_new('bar', version='4', state='Updated')
@@ -468,18 +468,18 @@ class MergeHistTransTests(unittest.TestCase):
merged = self._merge_new(trans)
self.assertMergedMain(merged, trans)
pkgs = merged.trans_data
- self.assertEquals(len(pkgs), 3)
- self.assertEquals(pkgs[0], opkg2)
- self.assertEquals(pkgs[1], npkg2)
- self.assertNotEquals(pkgs[2], opkg3)
- self.assertNotEquals(pkgs[2].state, 'Update')
- self.assertNotEquals(pkgs[2].state, opkg4.state)
- self.assertNotEquals(pkgs[2], npkg4)
- self.assertEquals(pkgs[2].pkgtup, npkg3.pkgtup)
+ self.assertEqual(len(pkgs), 3)
+ self.assertEqual(pkgs[0], opkg2)
+ self.assertEqual(pkgs[1], npkg2)
+ self.assertNotEqual(pkgs[2], opkg3)
+ self.assertNotEqual(pkgs[2].state, 'Update')
+ self.assertNotEqual(pkgs[2].state, opkg4.state)
+ self.assertNotEqual(pkgs[2], npkg4)
+ self.assertEqual(pkgs[2].pkgtup, npkg3.pkgtup)
if xstate == 'Obsoleting':
- self.assertEquals(pkgs[2].state, 'Obsoleting')
+ self.assertEqual(pkgs[2].state, 'Obsoleting')
else:
- self.assertEquals(pkgs[2].state, 'Reinstall')
+ self.assertEqual(pkgs[2].state, 'Reinstall')
def testDownUpMerge5(self, xstate='Downgrade'):
opkg2 = self._pkg_new('bar', version='4', state='Updated')
@@ -499,15 +499,15 @@ class MergeHistTransTests(unittest.TestCase):
merged = self._merge_new(trans)
self.assertMergedMain(merged, trans)
pkgs = merged.trans_data
- self.assertEquals(len(pkgs), 4)
- self.assertEquals(pkgs[0], opkg2)
- self.assertEquals(pkgs[0].state, opkg2.state)
- self.assertEquals(pkgs[1], npkg2)
- self.assertEquals(pkgs[1].state, npkg2.state)
- self.assertEquals(pkgs[2], npkg5)
- self.assertEquals(pkgs[2].state, xstate)
- self.assertEquals(pkgs[3], opkg3)
- self.assertEquals(pkgs[3].state, opkg3.state)
+ self.assertEqual(len(pkgs), 4)
+ self.assertEqual(pkgs[0], opkg2)
+ self.assertEqual(pkgs[0].state, opkg2.state)
+ self.assertEqual(pkgs[1], npkg2)
+ self.assertEqual(pkgs[1].state, npkg2.state)
+ self.assertEqual(pkgs[2], npkg5)
+ self.assertEqual(pkgs[2].state, xstate)
+ self.assertEqual(pkgs[3], opkg3)
+ self.assertEqual(pkgs[3].state, opkg3.state)
def testInRmMerge1(self, xstate='Install', estate='Erase'):
npkg1 = self._pkg_new('foo', state=xstate)
@@ -521,9 +521,9 @@ class MergeHistTransTests(unittest.TestCase):
merged = self._merge_new(trans)
self.assertMergedMain(merged, trans)
pkgs = merged.trans_data
- self.assertEquals(len(pkgs), 1)
- self.assertEquals(pkgs[0], npkg3)
- self.assertEquals(pkgs[0].state, npkg3.state)
+ self.assertEqual(len(pkgs), 1)
+ self.assertEqual(pkgs[0], npkg3)
+ self.assertEqual(pkgs[0].state, npkg3.state)
def testInRmMerge2(self, xstate='Install'):
self.testInRmMerge1(xstate, 'Obsoleted')
@@ -548,9 +548,9 @@ class MergeHistTransTests(unittest.TestCase):
merged = self._merge_new(trans)
self.assertMergedMain(merged, trans)
pkgs = merged.trans_data
- self.assertEquals(len(pkgs), 1)
- self.assertEquals(pkgs[0], npkg9)
- self.assertEquals(pkgs[0].state, npkg9.state)
+ self.assertEqual(len(pkgs), 1)
+ self.assertEqual(pkgs[0], npkg9)
+ self.assertEqual(pkgs[0].state, npkg9.state)
def testInRmInonlyMerge2(self, xstate='True-Install'):
self.testInRmInonlyMerge1(xstate, 'Obsoleted')
@@ -568,11 +568,11 @@ class MergeHistTransTests(unittest.TestCase):
merged = self._merge_new(trans)
self.assertMergedMain(merged, trans)
pkgs = merged.trans_data
- self.assertEquals(len(pkgs), 2)
- self.assertEquals(pkgs[0], opkg2)
- self.assertEquals(pkgs[0].state, npkg3.state)
- self.assertEquals(pkgs[1], npkg1)
- self.assertEquals(pkgs[1].state, npkg1.state)
+ self.assertEqual(len(pkgs), 2)
+ self.assertEqual(pkgs[0], opkg2)
+ self.assertEqual(pkgs[0].state, npkg3.state)
+ self.assertEqual(pkgs[1], npkg1)
+ self.assertEqual(pkgs[1].state, npkg1.state)
def testUpRmMerge2(self, xstate='True-Install'):
npkg1 = self._pkg_new('foo')
@@ -588,9 +588,9 @@ class MergeHistTransTests(unittest.TestCase):
merged = self._merge_new(trans)
self.assertMergedMain(merged, trans)
pkgs = merged.trans_data
- self.assertEquals(len(pkgs), 1)
- self.assertEquals(pkgs[0], npkg1)
- self.assertEquals(pkgs[0].state, npkg1.state)
+ self.assertEqual(len(pkgs), 1)
+ self.assertEqual(pkgs[0], npkg1)
+ self.assertEqual(pkgs[0].state, npkg1.state)
def testUpRmMerge3(self, xstate='Update'):
npkg1 = self._pkg_new('foo')
@@ -606,9 +606,9 @@ class MergeHistTransTests(unittest.TestCase):
merged = self._merge_new(trans)
self.assertMergedMain(merged, trans)
pkgs = merged.trans_data
- self.assertEquals(len(pkgs), 1)
- self.assertEquals(pkgs[0], npkg1)
- self.assertEquals(pkgs[0].state, npkg1.state)
+ self.assertEqual(len(pkgs), 1)
+ self.assertEqual(pkgs[0], npkg1)
+ self.assertEqual(pkgs[0].state, npkg1.state)
def testRmInMerge1(self, xstate='Install', estate='Erase'):
npkg1 = self._pkg_new('foo', state=xstate)
@@ -622,14 +622,14 @@ class MergeHistTransTests(unittest.TestCase):
merged = self._merge_new(trans)
self.assertMergedMain(merged, trans)
pkgs = merged.trans_data
- self.assertEquals(len(pkgs), 2)
- self.assertEquals(pkgs[0], npkg3)
- self.assertEquals(pkgs[0].state, npkg3.state)
- self.assertEquals(pkgs[1], npkg1)
+ self.assertEqual(len(pkgs), 2)
+ self.assertEqual(pkgs[0], npkg3)
+ self.assertEqual(pkgs[0].state, npkg3.state)
+ self.assertEqual(pkgs[1], npkg1)
if xstate == 'Obsoleting':
- self.assertEquals(pkgs[1].state, 'Obsoleting')
+ self.assertEqual(pkgs[1].state, 'Obsoleting')
else:
- self.assertEquals(pkgs[1].state, 'Reinstall')
+ self.assertEqual(pkgs[1].state, 'Reinstall')
def testRmInMerge2(self, xstate='Install'):
self.testRmInMerge1(xstate, 'Obsoleted')
@@ -650,16 +650,16 @@ class MergeHistTransTests(unittest.TestCase):
merged = self._merge_new(trans)
self.assertMergedMain(merged, trans)
pkgs = merged.trans_data
- self.assertEquals(len(pkgs), 3)
- self.assertEquals(pkgs[0], npkg1)
- self.assertEquals(pkgs[0].state, npkg1.state)
- self.assertEquals(pkgs[1].pkgtup, npkg4.pkgtup)
+ self.assertEqual(len(pkgs), 3)
+ self.assertEqual(pkgs[0], npkg1)
+ self.assertEqual(pkgs[0].state, npkg1.state)
+ self.assertEqual(pkgs[1].pkgtup, npkg4.pkgtup)
if ystate == 'Obsoleting':
- self.assertEquals(pkgs[1].state, "Obsoleting")
+ self.assertEqual(pkgs[1].state, "Obsoleting")
else:
- self.assertEquals(pkgs[1].state, "Downgrade")
- self.assertEquals(pkgs[2].pkgtup, opkg2.pkgtup)
- self.assertEquals(pkgs[2].state, "Downgraded")
+ self.assertEqual(pkgs[1].state, "Downgrade")
+ self.assertEqual(pkgs[2].pkgtup, opkg2.pkgtup)
+ self.assertEqual(pkgs[2].state, "Downgraded")
def testUpRmInlMerge2(self, xstate='Update', ystate='Install'):
self.testUpRmInlMerge1(xstate, ystate, 'Obsoleted')
@@ -680,16 +680,16 @@ class MergeHistTransTests(unittest.TestCase):
merged = self._merge_new(trans)
self.assertMergedMain(merged, trans)
pkgs = merged.trans_data
- self.assertEquals(len(pkgs), 3)
- self.assertEquals(pkgs[0], npkg1)
- self.assertEquals(pkgs[0].state, npkg1.state)
- self.assertEquals(pkgs[1].pkgtup, opkg2.pkgtup)
- self.assertEquals(pkgs[1].state, "Updated")
- self.assertEquals(pkgs[2].pkgtup, npkg4.pkgtup)
+ self.assertEqual(len(pkgs), 3)
+ self.assertEqual(pkgs[0], npkg1)
+ self.assertEqual(pkgs[0].state, npkg1.state)
+ self.assertEqual(pkgs[1].pkgtup, opkg2.pkgtup)
+ self.assertEqual(pkgs[1].state, "Updated")
+ self.assertEqual(pkgs[2].pkgtup, npkg4.pkgtup)
if ystate == 'Obsoleting':
- self.assertEquals(pkgs[2].state, "Obsoleting")
+ self.assertEqual(pkgs[2].state, "Obsoleting")
else:
- self.assertEquals(pkgs[2].state, "Update")
+ self.assertEqual(pkgs[2].state, "Update")
def testUpRmInuMerge2(self, xstate='Update', ystate='Install'):
self.testUpRmInuMerge1(xstate, ystate, 'Obsoleted')
@@ -717,13 +717,13 @@ class MergeHistTransTests(unittest.TestCase):
merged = self._merge_new(trans)
self.assertMergedMain(merged, trans)
pkgs = merged.trans_data
- self.assertEquals(len(pkgs), 3)
- self.assertEquals(pkgs[0], opkg1)
- self.assertEquals(pkgs[0].state, 'Updated')
- self.assertEquals(pkgs[1], opkg2)
- self.assertEquals(pkgs[1].state, 'Updated')
- self.assertEquals(pkgs[2], opkg3)
- self.assertEquals(pkgs[2].state, estate)
+ self.assertEqual(len(pkgs), 3)
+ self.assertEqual(pkgs[0], opkg1)
+ self.assertEqual(pkgs[0].state, 'Updated')
+ self.assertEqual(pkgs[1], opkg2)
+ self.assertEqual(pkgs[1].state, 'Updated')
+ self.assertEqual(pkgs[2], opkg3)
+ self.assertEqual(pkgs[2].state, estate)
# Obsoleting is the _painful_ one because it really should be a state, but
# an attribute. So "Obsoleting" can be any of:
diff --git a/test/misc-tests.py b/test/misc-tests.py
index d34c161..072d6d0 100644
--- a/test/misc-tests.py
+++ b/test/misc-tests.py
@@ -63,7 +63,7 @@ class MiscTests(DepsolveTests):
D = self.repoPackage('D', '1',arch='i386')
D.addProvides('LibD')
self.tsInfo.addInstall(A)
- self.assertEquals('ok', *self.resolveCode(skip=False))
+ self.assertEqual('ok', *self.resolveCode(skip=False))
# This one is disabled because, we no it fails, but we dont want it to bail out in the each testcase run
# Just enable it to do the test
# self.assertResult([A,BCD])
@@ -88,7 +88,7 @@ class MiscTests(DepsolveTests):
D = self.repoPackage('LibD', '1',arch='i386')
D.addProvides('LibD')
self.tsInfo.addInstall(A)
- self.assertEquals('ok', *self.resolveCode(skip=False))
+ self.assertEqual('ok', *self.resolveCode(skip=False))
self.assertResult([A,BCD])
def resolveCode(self,skip = False):
diff --git a/test/operationstests.py b/test/operationstests.py
index 5a50439..076d000 100644
--- a/test/operationstests.py
+++ b/test/operationstests.py
@@ -15,7 +15,7 @@ class ComplicatedTests(OperationsTests):
p = self.pkgs
res, msg = self.runOperation(['install', 'super-zippy'], [p.installed_i386], [p.obsoletes_i386, p.obsoletes_x86_64, p.conflicts])
if new_behavior:
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.obsoletes_i386, p.conflicts))
class CombinedUpdateObsoletesTest(OperationsTests):
@@ -40,14 +40,14 @@ class CombinedUpdateObsoletesTest(OperationsTests):
def testSelfObsolete(self):
p = self.pkgs
res, msg = self.runOperation(['update'], [p.klibs_1_x86_64], [p.klibs_2_i386, p.klibs_2_x86_64])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.klibs_2_x86_64,))
def testPackageSplitWithObsoleteAndRequiresForUpdate(self):
p = self.pkgs
res, msg = self.runOperation(['update'], [p.k_1, p.kdevel_1, p.klibs_1_x86_64],
[p.k_2, p.kdevel_2, p.klibs_2_x86_64])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.k_2, p.kdevel_2, p.klibs_2_x86_64,))
@@ -67,7 +67,7 @@ class ComplicatedObsoletesTests(OperationsTests):
def testObsoleteChain(self):
p = self.pkgs
res, msg = self.runOperation(['update'], [p.installed], [p.obsoletes, p.obsoletes2])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
if True or new_behavior:
self.assertResult((p.obsoletes2,))
else:
@@ -75,13 +75,13 @@ class ComplicatedObsoletesTests(OperationsTests):
def testObsoleteChainNext(self):
p = self.pkgs
res, msg = self.runOperation(['update'], [p.obsoletes], [p.obsoletes2])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.obsoletes2,))
def testObsoleteCircle(self):
p = self.pkgs
res, msg = self.runOperation(['update'], [p.obsoletecircle], [p.obsoletes, p.obsoletes2])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
if new_behavior:
self.assertResult((p.obsoletecircle,))
else:
@@ -89,7 +89,7 @@ class ComplicatedObsoletesTests(OperationsTests):
def testObsoleteCircleNext(self):
p = self.pkgs
res, msg = self.runOperation(['update'], [p.obsoletes], [p.obsoletecircle, p.obsoletes, p.obsoletes2])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
if new_behavior:
self.assertResult((p.obsoletes,))
else:
@@ -97,7 +97,7 @@ class ComplicatedObsoletesTests(OperationsTests):
def testObsoleteCircleNextNext(self):
p = self.pkgs
res, msg = self.runOperation(['update'], [p.obsoletes2], [p.obsoletecircle, p.obsoletes, p.obsoletes2])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
if new_behavior:
self.assertResult((p.obsoletes2,))
else:
@@ -105,7 +105,7 @@ class ComplicatedObsoletesTests(OperationsTests):
def testObsoleteCircleNextNextNext(self):
p = self.pkgs
res, msg = self.runOperation(['update'], [p.obsoletecircle], [p.obsoletes, p.obsoletes2])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
if new_behavior:
self.assertResult((p.obsoletecircle,))
else:
diff --git a/test/packagetests.py b/test/packagetests.py
index 1e3302b..a1035ab 100644
--- a/test/packagetests.py
+++ b/test/packagetests.py
@@ -164,24 +164,24 @@ class BuildPackageDictRefTests(unittest.TestCase):
def testNoPkg(self):
pkgs = []
- self.assertEquals({}, packages.buildPkgRefDict(pkgs))
+ self.assertEqual({}, packages.buildPkgRefDict(pkgs))
def testOnePkg(self):
pkg = StubPkg("yum", "noarch", 0, "3.1.1", 2)
pkgs = [pkg]
pkg_dict = packages.buildPkgRefDict(pkgs)
- self.assertEquals(7, len(pkg_dict))
+ self.assertEqual(7, len(pkg_dict))
unseen_keys = ['yum', 'yum.noarch', 'yum-3.1.1-2.noarch', 'yum-3.1.1',
'yum-3.1.1-2', '0:yum-3.1.1-2.noarch', 'yum-0:3.1.1-2.noarch']
- for key in pkg_dict.keys():
+ for key in list(pkg_dict.keys()):
self.assertTrue(key in unseen_keys)
unseen_keys.remove(key)
- self.assertEquals(1, len(pkg_dict[key]))
- self.assertEquals(pkg, pkg_dict[key][0])
+ self.assertEqual(1, len(pkg_dict[key]))
+ self.assertEqual(pkg, pkg_dict[key][0])
- self.assertEquals(0, len(unseen_keys))
+ self.assertEqual(0, len(unseen_keys))
def _perms(evr): # Magic comp. sci. stuff ... oooh
e, v, r = evr
@@ -205,8 +205,8 @@ class RangeCompareTests(unittest.TestCase):
def testRangeCompare(self):
def tst(requires, provides, result):
- print requires, provides
- self.assertEquals(miscutils.rangeCompare(requires, provides),result)
+ print(requires, provides)
+ self.assertEqual(miscutils.rangeCompare(requires, provides),result)
def tst_lege_prov(requires, provides, result):
if not result or provides[1] != 'EQ':
return
diff --git a/test/rpmdb-cache.py b/test/rpmdb-cache.py
index 7768a93..fdfc92f 100755
--- a/test/rpmdb-cache.py
+++ b/test/rpmdb-cache.py
@@ -11,7 +11,7 @@ yb2 = yum.YumBase()
yb2.conf.cache = True
if len(sys.argv) > 1 and sys.argv[1].lower() == 'full':
- print "Doing full test"
+ print("Doing full test")
__provides_of_requires_exact__ = True
assert hasattr(yb1.rpmdb, '__cache_rpmdb__')
@@ -22,66 +22,66 @@ yb2.setCacheDir()
ver1 = yb1.rpmdb.simpleVersion(main_only=True)[0]
ver2 = yb2.rpmdb.simpleVersion(main_only=True)[0]
if ver1 != ver2:
- print >>sys.stderr, "Error: Version mismatch:", ver1, ver2
+ print("Error: Version mismatch:", ver1, ver2, file=sys.stderr)
# Conflicts
cpkgs1 = yb1.rpmdb.returnConflictPackages()
cpkgs2 = yb2.rpmdb.returnConflictPackages()
if len(cpkgs1) != len(cpkgs2):
- print >>sys.stderr, "Error: Conflict len mismatch:", len(cpkgs1),len(cpkgs2)
+ print("Error: Conflict len mismatch:", len(cpkgs1),len(cpkgs2), file=sys.stderr)
for pkg in cpkgs1:
if pkg not in cpkgs2:
- print >>sys.stderr, "Error: Conflict cache missing", pkg
+ print("Error: Conflict cache missing", pkg, file=sys.stderr)
for pkg in cpkgs2:
if pkg not in cpkgs1:
- print >>sys.stderr, "Error: Conflict cache extra", pkg
+ print("Error: Conflict cache extra", pkg, file=sys.stderr)
# File Requires
frd1, blah, fpd1 = yb1.rpmdb.fileRequiresData()
frd2, blah, fpd2 = yb2.rpmdb.fileRequiresData()
if len(frd1) != len(frd2):
- print >>sys.stderr, "Error: FileReq len mismatch:", len(frd1), len(frd2)
+ print("Error: FileReq len mismatch:", len(frd1), len(frd2), file=sys.stderr)
for pkgtup in frd1:
if pkgtup not in frd2:
- print >>sys.stderr, "Error: FileReq cache missing", pkgtup
+ print("Error: FileReq cache missing", pkgtup, file=sys.stderr)
continue
if len(set(frd1[pkgtup])) != len(set(frd2[pkgtup])):
- print >>sys.stderr, ("Error: FileReq[%s] len mismatch:" % (pkgtup,),
- len(frd1[pkgtup]), len(frd2[pkgtup]))
+ print(("Error: FileReq[%s] len mismatch:" % (pkgtup,),
+ len(frd1[pkgtup]), len(frd2[pkgtup])), file=sys.stderr)
for name in frd1[pkgtup]:
if name not in frd2[pkgtup]:
- print >>sys.stderr, ("Error: FileReq[%s] cache missing" % (pkgtup,),
- name)
+ print(("Error: FileReq[%s] cache missing" % (pkgtup,),
+ name), file=sys.stderr)
for pkgtup in frd2:
if pkgtup not in frd1:
- print >>sys.stderr, "Error: FileReq cache extra", pkgtup
+ print("Error: FileReq cache extra", pkgtup, file=sys.stderr)
continue
for name in frd2[pkgtup]:
if name not in frd1[pkgtup]:
- print >>sys.stderr, ("Error: FileReq[%s] cache extra" % (pkgtup,),
- name)
+ print(("Error: FileReq[%s] cache extra" % (pkgtup,),
+ name), file=sys.stderr)
# File Provides (of requires) -- not exact
if len(fpd1) != len(fpd2):
- print >>sys.stderr, "Error: FileProv len mismatch:", len(fpd1), len(fpd2)
+ print("Error: FileProv len mismatch:", len(fpd1), len(fpd2), file=sys.stderr)
for name in fpd1:
if name not in fpd2:
- print >>sys.stderr, "Error: FileProv cache missing", name
+ print("Error: FileProv cache missing", name, file=sys.stderr)
continue
if not __provides_of_requires_exact__:
continue # We might be missing some providers
if len(fpd1[name]) != len(fpd2[name]):
- print >>sys.stderr, ("Error: FileProv[%s] len mismatch:" % (pkgtup,),
- len(fpd1[name]), len(fpd2[name]))
+ print(("Error: FileProv[%s] len mismatch:" % (pkgtup,),
+ len(fpd1[name]), len(fpd2[name])), file=sys.stderr)
for pkgtup in fpd1[name]:
if pkgtup not in fpd2[name]:
- print >>sys.stderr,"Error: FileProv[%s] cache missing" % name,pkgtup
+ print("Error: FileProv[%s] cache missing" % name,pkgtup, file=sys.stderr)
for name in fpd2:
if name not in fpd1:
- print >>sys.stderr, "Error: FileProv cache extra", name
+ print("Error: FileProv cache extra", name, file=sys.stderr)
continue
for pkgtup in fpd2[name]:
if pkgtup not in fpd1[name]:
- print >>sys.stderr,"Error: FileProv[%s] cache extra" % name,pkgtup
+ print("Error: FileProv[%s] cache extra" % name,pkgtup, file=sys.stderr)
diff --git a/test/simpleobsoletestests.py b/test/simpleobsoletestests.py
index 97a9923..2055cd9 100644
--- a/test/simpleobsoletestests.py
+++ b/test/simpleobsoletestests.py
@@ -27,43 +27,43 @@ class SimpleObsoletesTests(OperationsTests):
def testObsoletenoarchTonoarch(self):
p = self.pkgs
res, msg = self.runOperation(['update'], [p.installed_noarch], [p.obsoletes_noarch])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.obsoletes_noarch,))
def testObsoletenoarchTonoarchForDependency(self):
p = self.pkgs
res, msg = self.runOperation(['install', 'superzippy'], [p.installed_noarch],
[p.obsoletes_noarch, p.requires_obsoletes])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.obsoletes_noarch, p.requires_obsoletes))
def testObsoletenoarchToi386(self):
p = self.pkgs
res, msg = self.runOperation(['update'], [p.installed_noarch], [p.obsoletes_i386])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.obsoletes_i386,))
def testObsoletenoarchToi386ForDependency(self):
p = self.pkgs
res, msg = self.runOperation(['install', 'superzippy'], [p.installed_noarch],
[p.obsoletes_i386, p.requires_obsoletes])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.obsoletes_i386, p.requires_obsoletes))
def testObsoletenoarchTox86_64(self):
p = self.pkgs
res, msg = self.runOperation(['update'], [p.installed_noarch], [p.obsoletes_x86_64])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.obsoletes_x86_64,))
def testObsoletenoarchTox86_64ForDependency(self):
p = self.pkgs
res, msg = self.runOperation(['install', 'superzippy'], [p.installed_noarch],
[p.obsoletes_x86_64, p.requires_obsoletes])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.obsoletes_x86_64, p.requires_obsoletes))
def testObsoletenoarchToMultiarch(self):
p = self.pkgs
res, msg = self.runOperation(['update'], [p.installed_noarch], [p.obsoletes_i386, p.obsoletes_x86_64])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
if new_behavior:
self.assertResult((p.obsoletes_x86_64,), (p.obsoletes_i386,))
else:
@@ -72,7 +72,7 @@ class SimpleObsoletesTests(OperationsTests):
p = self.pkgs
res, msg = self.runOperation(['install', 'superzippy'], [p.installed_noarch],
[p.obsoletes_i386, p.obsoletes_x86_64, p.requires_obsoletes])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.obsoletes_x86_64, p.requires_obsoletes), (p.obsoletes_i386,))
# i386 to X
@@ -80,46 +80,46 @@ class SimpleObsoletesTests(OperationsTests):
def testObsoletei386Tonoarch(self):
p = self.pkgs
res, msg = self.runOperation(['update'], [p.installed_i386], [p.obsoletes_noarch])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.obsoletes_noarch,))
def testObsoletei386TonoarchForDependency(self):
p = self.pkgs
res, msg = self.runOperation(['install', 'superzippy'], [p.installed_i386], [p.obsoletes_noarch, p.requires_obsoletes])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.obsoletes_noarch, p.requires_obsoletes))
def testObsoletei386Toi386(self):
p = self.pkgs
res, msg = self.runOperation(['update'], [p.installed_i386], [p.obsoletes_i386])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.obsoletes_i386,))
def testObsoletei386Toi386ForDependency(self):
p = self.pkgs
res, msg = self.runOperation(['install', 'superzippy'], [p.installed_i386], [p.obsoletes_i386, p.requires_obsoletes])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.obsoletes_i386, p.requires_obsoletes))
def testObsoletei386Tox86_64(self):
p = self.pkgs
res, msg = self.runOperation(['update'], [p.installed_i386], [p.obsoletes_x86_64])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.obsoletes_x86_64,))
def testObsoletei386Tox86_64ForDependency(self):
p = self.pkgs
res, msg = self.runOperation(['install', 'superzippy'], [p.installed_i386], [p.obsoletes_x86_64, p.requires_obsoletes])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.obsoletes_x86_64, p.requires_obsoletes))
def testObsoletei386ToMultiarch(self):
p = self.pkgs
res, msg = self.runOperation(['update'], [p.installed_i386], [p.obsoletes_i386, p.obsoletes_x86_64])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.obsoletes_i386,))
def testObsoletei386ToMultiarchForDependency(self):
p = self.pkgs
res, msg = self.runOperation(['install', 'superzippy'], [p.installed_i386], [p.obsoletes_i386, p.obsoletes_x86_64, p.requires_obsoletes])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.obsoletes_i386, p.requires_obsoletes))
# x86_64 to X
@@ -127,67 +127,67 @@ class SimpleObsoletesTests(OperationsTests):
def testObsoletex86_64Tonoarch(self):
p = self.pkgs
res, msg = self.runOperation(['update'], [p.installed_x86_64], [p.obsoletes_noarch])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.obsoletes_noarch,))
def testObsoletex86_64TonoarchForDependency(self):
p = self.pkgs
res, msg = self.runOperation(['install', 'superzippy'], [p.installed_x86_64], [p.obsoletes_noarch, p.requires_obsoletes])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.obsoletes_noarch, p.requires_obsoletes))
def testObsoletex86_64Toi386(self):
p = self.pkgs
res, msg = self.runOperation(['update'], [p.installed_x86_64], [p.obsoletes_i386])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.obsoletes_i386,))
def testObsoletex86_64Toi386ForDependency(self):
p = self.pkgs
res, msg = self.runOperation(['install', 'superzippy'], [p.installed_x86_64], [p.obsoletes_i386, p.requires_obsoletes])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.obsoletes_i386, p.requires_obsoletes))
def testObsoletex86_64Tox86_64(self):
p = self.pkgs
res, msg = self.runOperation(['update'], [p.installed_x86_64], [p.obsoletes_x86_64])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.obsoletes_x86_64,))
def testObsoletex86_64Tox86_64ForDependency(self):
p = self.pkgs
res, msg = self.runOperation(['install', 'superzippy'], [p.installed_x86_64], [p.obsoletes_x86_64, p.requires_obsoletes])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.obsoletes_x86_64, p.requires_obsoletes))
def testObsoletex86_64ToMultiarch1(self):
p = self.pkgs
res, msg = self.runOperation(['update'], [p.installed_x86_64], [p.obsoletes_i386, p.obsoletes_x86_64])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.obsoletes_x86_64,))
def testObsoletex86_64ToMultiarch2(self):
p = self.pkgs
res, msg = self.runOperation(['update'], [p.installed_x86_64], [p.obsoletes_x86_64, p.obsoletes_i386])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.obsoletes_x86_64,))
def testInstallObsoletex86_64ToMultiarch1(self):
# Found by BZ 593349, libgfortran43/44
p = self.pkgs
res, msg = self.runOperation(['install', 'zsh.x86_64'], [], [p.installed_x86_64, p.installed_i386, p.obsoletes_x86_64, p.obsoletes_i386])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.obsoletes_x86_64,))
def testInstallObsoletex86_64ToMultiarch2(self):
p = self.pkgs
res, msg = self.runOperation(['install', 'zsh.i386'], [], [p.installed_x86_64, p.installed_i386, p.obsoletes_x86_64, p.obsoletes_i386])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.obsoletes_i386,))
def testInstallObsoletex86_64ToMultiarch3(self):
p = self.pkgs
res, msg = self.runOperation(['install', 'zsh'], [], [p.installed_noarch, p.obsoletes_x86_64, p.obsoletes_i386])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.obsoletes_x86_64,))
def testObsoletex86_64ToMultiarchForDependency(self):
p = self.pkgs
res, msg = self.runOperation(['install', 'superzippy'],
[p.installed_x86_64], [p.obsoletes_i386, p.obsoletes_x86_64, p.requires_obsoletes])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.obsoletes_x86_64, p.requires_obsoletes))
# multiarch to X
@@ -195,53 +195,53 @@ class SimpleObsoletesTests(OperationsTests):
def testObsoleteMultiarchTonoarch(self):
p = self.pkgs
res, msg = self.runOperation(['update'], [p.installed_i386, p.installed_x86_64], [p.obsoletes_noarch])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.obsoletes_noarch,))
def testObsoleteMultiarchTonoarchForDependency(self):
p = self.pkgs
res, msg = self.runOperation(['install', 'superzippy'], [p.installed_i386, p.installed_x86_64], [p.obsoletes_noarch, p.requires_obsoletes])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.obsoletes_noarch, p.requires_obsoletes))
def testObsoleteMultiarchToi386(self):
p = self.pkgs
res, msg = self.runOperation(['update'], [p.installed_i386, p.installed_x86_64], [p.obsoletes_i386])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.obsoletes_i386,))
def testObsoleteMultiarchToi386ForDependency(self):
p = self.pkgs
res, msg = self.runOperation(['install', 'superzippy'], [p.installed_i386, p.installed_x86_64], [p.obsoletes_i386, p.requires_obsoletes])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.obsoletes_i386, p.requires_obsoletes))
def testObsoleteMultiarchTox86_64(self):
p = self.pkgs
res, msg = self.runOperation(['update'], [p.installed_i386, p.installed_x86_64], [p.obsoletes_x86_64])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.obsoletes_x86_64,))
def testObsoleteMultiarchTox86_64ForDependency(self):
p = self.pkgs
res, msg = self.runOperation(['install', 'superzippy'], [p.installed_i386, p.installed_x86_64], [p.obsoletes_x86_64, p.requires_obsoletes])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.obsoletes_x86_64, p.requires_obsoletes))
def testObsoleteMultiarchToMultiarch(self):
p = self.pkgs
res, msg = self.runOperation(['update'], [p.installed_i386, p.installed_x86_64], [p.obsoletes_i386, p.obsoletes_x86_64])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.obsoletes_i386, p.obsoletes_x86_64))
def testObsoleteMultiarchToMultiarchForDependency(self):
p = self.pkgs
res, msg = self.runOperation(['install', 'superzippy'],
[p.installed_i386, p.installed_x86_64], [p.obsoletes_i386, p.obsoletes_x86_64, p.requires_obsoletes])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.obsoletes_i386, p.obsoletes_x86_64, p.requires_obsoletes))
def testInstallObsoletenoarchTonoarch(self):
p = self.pkgs
res, msg = self.runOperation(['install', 'zsh-ng'], [p.installed_noarch], [p.obsoletes_noarch])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.obsoletes_noarch,))
def _MultiObsHelper(self):
@@ -267,21 +267,21 @@ class SimpleObsoletesTests(OperationsTests):
pkgs = self._MultiObsHelper()
res, msg = self.runOperation(['install', 'fish'],
pkgs['pi'], pkgs['po'])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((pkgs['ksh'],pkgs['nash'],pkgs['fish'],))
def testMultiObs2(self):
pkgs = self._MultiObsHelper()
res, msg = self.runOperation(['install', 'bigfish'],
pkgs['pi'], pkgs['po'])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((pkgs['nash'],pkgs['bigfish'],))
def testMultiObs3(self):
pkgs = self._MultiObsHelper()
res, msg = self.runOperation(['install', 'shark'],
pkgs['pi'], pkgs['po'])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((pkgs['shark'],))
def testMultiObs4(self):
@@ -291,7 +291,7 @@ class SimpleObsoletesTests(OperationsTests):
res, msg = self.runOperation(['update', 'shark'],
pkgs['pi'] + [oldshark], pkgs['po'])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((pkgs['shark'],))
def testMultiObs5(self):
@@ -301,7 +301,7 @@ class SimpleObsoletesTests(OperationsTests):
res, msg = self.runOperation(['update', 'nash'],
pkgs['pi'] + [oldshark], pkgs['po'])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((pkgs['shark'],))
# NOTE: Do we really want to remove the old kernel-xen? ... not 100% sure
@@ -317,7 +317,7 @@ class SimpleObsoletesTests(OperationsTests):
res, msg = self.runOperation(['update', 'kernel'],
[okern1, okernxen1,
okern2, okernxen2], [nkern])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((okern1,okern2,nkern,))
def testMultiObsKern2(self):
@@ -332,7 +332,7 @@ class SimpleObsoletesTests(OperationsTests):
res, msg = self.runOperation(['update', 'kernel-xen'],
[okern1, okernxen1,
okern2, okernxen2], [nkern])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((okern1,okern2,nkern,))
def testMultiObsKern3(self):
@@ -347,7 +347,7 @@ class SimpleObsoletesTests(OperationsTests):
res, msg = self.runOperation(['update'],
[okern1, okernxen1,
okern2, okernxen2], [nkern])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((okern1,okern2,nkern,))
def testIncluderObs1(self):
@@ -371,7 +371,7 @@ class SimpleObsoletesTests(OperationsTests):
res, msg = self.runOperation(['update', 'postfix'],
[pfix1, dep], [exim, pnewfix, pfix2, dep])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((dep, pfix2, pnewfix))
def testIncluderObs2(self):
@@ -395,7 +395,7 @@ class SimpleObsoletesTests(OperationsTests):
res, msg = self.runOperation(['update', 'postfix'],
[dep, pfix1], [dep, pfix2, pnewfix, exim])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((dep, pfix2, pnewfix))
def testIncluderObs3(self):
@@ -419,7 +419,7 @@ class SimpleObsoletesTests(OperationsTests):
res, msg = self.runOperation(['install', 'postfix-blah'],
[dep, pfix1], [dep, pfix2, pnewfix, exim])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((dep, pfix2, pnewfix))
def testConflictMultiplePkgs(self):
@@ -441,7 +441,7 @@ class SimpleObsoletesTests(OperationsTests):
res, msg = self.runOperation(['install', 'baz'],
[rp1], [ap, aop, dep1, dep2, dep3])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((ap, aop, dep1, dep2, dep3))
def testMultipleObsoleters(self):
@@ -456,7 +456,7 @@ class SimpleObsoletesTests(OperationsTests):
res, msg = self.runOperation(['update'],
[rp1], [aop1, aop2])
- self.assert_(res=='err', msg)
+ self.assertTrue(res=='err', msg)
# FIXME: This is really what should happen, but just sucking works too
# self.assert_(res=='ok', msg)
# self.assertResult((aop1,))
@@ -495,42 +495,42 @@ class SimpleObsoletesTests(OperationsTests):
rps, aps, ret, all = self._helperRLDaplMess()
res, msg = self.runOperation(['update'], rps, aps)
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult(ret)
def testRLDaplMess2(self):
rps, aps, ret, all = self._helperRLDaplMess()
res, msg = self.runOperation(['update', 'dapl'], rps, aps)
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult(ret)
def testRLDaplMess3(self):
rps, aps, ret, all = self._helperRLDaplMess()
res, msg = self.runOperation(['update', 'dapl-devel'], rps, aps)
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult(ret)
def testRLDaplMess4(self):
rps, aps, ret, all = self._helperRLDaplMess()
res, msg = self.runOperation(['install', 'compat-dapl'], rps, aps)
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult(ret)
def testRLDaplMess5(self):
rps, aps, ret, all = self._helperRLDaplMess()
res, msg = self.runOperation(['install', 'compat-dapl-devel'], rps, aps)
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult(ret)
def testRLDaplMess6(self):
rps, aps, ret, all = self._helperRLDaplMess()
res, msg = self.runOperation(['install', 'compat-dapl-1.2.5'], rps, aps)
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult(ret)
def testRLDaplMess7(self):
@@ -538,7 +538,7 @@ class SimpleObsoletesTests(OperationsTests):
res, msg = self.runOperation(['install', 'compat-dapl-devel-1.2.5'],
rps, aps)
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult(ret)
# Now we get a bit weird, as we have obsoletes fighting with updates
@@ -546,39 +546,39 @@ class SimpleObsoletesTests(OperationsTests):
rps, aps, ret, all = self._helperRLDaplMess()
res, msg = self.runOperation(['install', 'dapl-1.2.1.1-7'], rps, aps)
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult(ret)
def testRLDaplMessWeirdInst2(self):
rps, aps, ret, all = self._helperRLDaplMess()
res, msg = self.runOperation(['install', 'dapl-2.0.15',
'dapl-devel-2.0.15'], rps, aps)
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((all['arp3'], all['arp4']))
def testRLDaplMessWeirdInst3(self):
rps, aps, ret, all = self._helperRLDaplMess()
res, msg = self.runOperation(['install', 'dapl-2.0.15'], rps, aps)
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((all['arp3'], all['arp4']))
def testRLDaplMessWeirdUp1(self):
rps, aps, ret, all = self._helperRLDaplMess()
res, msg = self.runOperation(['update', 'dapl-1.2.1.1-7'], rps, aps)
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult(ret)
def testRLDaplMessWeirdUp2(self):
rps, aps, ret, all = self._helperRLDaplMess()
res, msg = self.runOperation(['update', 'dapl-2.0.15',
'dapl-devel-2.0.15'], rps, aps)
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((all['arp3'], all['arp4']))
def testRLDaplMessWeirdUp3(self):
rps, aps, ret, all = self._helperRLDaplMess()
res, msg = self.runOperation(['update', 'dapl-2.0.15'], rps, aps)
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((all['arp3'], all['arp4']))
def testRLDaplFixUpdateNotInstall(self):
@@ -615,12 +615,12 @@ class GitMetapackageObsoletesTests(OperationsTests):
p = self.pkgs
res, msg = self.runOperation(['update'], [p.installed],
[p.new_git, p.git_all])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.new_git,))
def testGitMetapackageRenameMetapackageAndCoreInstalled(self):
p = self.pkgs
res, msg = self.runOperation(['update'], [p.installed, p.metapackage],
[p.new_git, p.git_all])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.new_git, p.git_all))
diff --git a/test/simpleremovetests.py b/test/simpleremovetests.py
index be820bc..3d4a8ed 100644
--- a/test/simpleremovetests.py
+++ b/test/simpleremovetests.py
@@ -22,43 +22,43 @@ class SimpleRemoveTests(OperationsTests):
def testRemoveSingle(self):
p = self.pkgs
res, msg = self.runOperation(['remove', 'foo'], [p.leaf], [])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult( () )
def testRemoveRequired(self):
p = self.pkgs
res, msg = self.runOperation(['remove', 'foo'], [p.leaf, p.requires_leaf], [])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult( () )
def testRemoveRequiredMissing(self):
p = self.pkgs
res, msg = self.runOperation(['remove', 'bar'], [p.requires_leaf], [])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult( () )
def testRemoveRequiredProvided(self):
p = self.pkgs
res, msg = self.runOperation(['remove', 'foo'], [p.leaf, p.requires_leaf, p.provides_leaf], [])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult( (p.requires_leaf, p.provides_leaf) )
def testRemoveRequiredAvailable(self):
p = self.pkgs
res, msg = self.runOperation(['remove', 'foo'], [p.leaf, p.requires_leaf], [p.provides_leaf])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult( () )
def testRemoveRequiredChain(self):
p = self.pkgs
res, msg = self.runOperation(['remove', 'foo'], [p.leaf, p.requires_leaf, p.rr_leaf], [])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult( () )
def testRemoveRequiredFile(self):
p = self.pkgs
res, msg = self.runOperation(['remove', 'foo'], [p.leaf, p.requires_file], [])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult( () )
def testShellUpRm1(self):
@@ -72,7 +72,7 @@ class SimpleRemoveTests(OperationsTests):
),
[pi1],
[pa1], multi_cmds=True)
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult(())
def testShellUpRm2(self):
@@ -88,7 +88,7 @@ class SimpleRemoveTests(OperationsTests):
),
[pi1, pi2],
[pa1, pa2], multi_cmds=True)
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((pi1, ))
def testShellUpRm3(self):
@@ -104,7 +104,7 @@ class SimpleRemoveTests(OperationsTests):
),
[pi1, pi2],
[pa1, pa2], multi_cmds=True)
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((pi2, ))
def testShellUpRm4(self):
@@ -120,6 +120,6 @@ class SimpleRemoveTests(OperationsTests):
),
[pi1, pi2],
[pa1, pa2], multi_cmds=True)
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((pi1,))
diff --git a/test/simpleupdatetests.py b/test/simpleupdatetests.py
index 6177fb1..8a9d617 100644
--- a/test/simpleupdatetests.py
+++ b/test/simpleupdatetests.py
@@ -40,58 +40,58 @@ class SimpleUpdateTests(OperationsTests):
def testUpdatenoarchTonoarch(self):
p = self.pkgs
res, msg = self.runOperation(['update'], [p.installed_noarch], [p.update_noarch,])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.update_noarch,))
def testUpdatenoarchTonoarchForDependency(self):
p = self.pkgs
res, msg = self.runOperation(['install', 'zsh-utils'], [p.installed_noarch], [p.update_noarch, p.requires_update])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.update_noarch, p.requires_update))
def testUpdatenoarchTonoarchForDependency2(self):
p = self.pkgs
res, msg = self.runOperation(['update', 'bar'], [p.required, p.installed_noarch],
[p.required_updated, p.update_noarch,])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.required_updated, p.update_noarch,))
def testUpdatenoarchToi386(self):
p = self.pkgs
res, msg = self.runOperation(['update'], [p.installed_noarch], [p.update_i386,])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.update_i386,))
def testUpdatenoarchToi386ForDependency(self):
p = self.pkgs
res, msg = self.runOperation(['install', 'zsh-utils'], [p.installed_noarch], [p.update_i386, p.requires_update])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.update_i386, p.requires_update))
def testUpdatenoarchToi386ForDependency2(self):
p = self.pkgs
res, msg = self.runOperation(['update', 'bar'], [p.required, p.installed_noarch],
[p.required_updated, p.update_i386])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.required_updated, p.update_i386))
def testUpdatenoarchTox86_64(self):
p = self.pkgs
res, msg = self.runOperation(['update'], [p.installed_noarch], [p.update_x86_64,])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.update_x86_64,))
def testUpdatenoarchTox86_64ForDependency(self):
p = self.pkgs
res, msg = self.runOperation(['install', 'zsh-utils'], [p.installed_noarch], [p.update_x86_64, p.requires_update])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.update_x86_64, p.requires_update))
def testUpdatenoarchTox86_64ForDependency2(self):
p = self.pkgs
res, msg = self.runOperation(['update', 'bar'], [p.required, p.installed_noarch],
[p.required_updated, p.update_x86_64])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.required_updated, p.update_x86_64))
def testUpdatenoarchToMultilib(self):
p = self.pkgs
res, msg = self.runOperation(['update'], [p.installed_noarch], [p.update_i386, p.update_x86_64])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
if True or new_behavior: # We update from .noarch to just the .x86_64
self.assertResult((p.update_x86_64,), (p.update_i386,)) # ?
else: # Updates to both...
@@ -99,18 +99,18 @@ class SimpleUpdateTests(OperationsTests):
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)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.update_x86_64, 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.assertTrue(res=='ok', msg)
self.assertResult((p.update_x86_64, p.requires_update))
def testUpdatenoarchToMultilibForDependency2(self):
p = self.pkgs
res, msg = self.runOperation(['update', 'bar'], [p.required, p.installed_noarch],
[p.required_updated, p.update_i386, p.update_x86_64])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.required_updated, p.update_x86_64), (p.update_i386,))
# i386 to X
@@ -118,69 +118,69 @@ class SimpleUpdateTests(OperationsTests):
def testUpdatei386Tonoarch(self):
p = self.pkgs
res, msg = self.runOperation(['update'], [p.installed_i386], [p.update_noarch])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.update_noarch,))
def testUpdatei386TonoarchForDependency(self):
p = self.pkgs
res, msg = self.runOperation(['install', 'zsh-utils'], [p.installed_i386], [p.update_noarch, p.requires_update])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.update_noarch, p.requires_update))
def testUpdatei386TonoarchForDependency2(self):
p = self.pkgs
res, msg = self.runOperation(['update', 'bar'], [p.required, p.installed_i386],
[p.required_updated, p.update_noarch,])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.required_updated, p.update_noarch,))
def testUpdatei386Toi386(self):
p = self.pkgs
res, msg = self.runOperation(['update'], [p.installed_i386], [p.update_i386])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.update_i386,))
def testUpdatei386Toi386ForDependency(self):
p = self.pkgs
res, msg = self.runOperation(['install', 'zsh-utils'], [p.installed_i386], [p.update_i386, p.requires_update])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.update_i386, p.requires_update))
def testUpdatei386Toi386ForDependency2(self):
p = self.pkgs
res, msg = self.runOperation(['update', 'bar'], [p.required, p.installed_i386],
[p.required_updated, p.update_i386])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.required_updated, p.update_i386))
def testUpdatei386Tox86_64(self):
p = self.pkgs
res, msg = self.runOperation(['update'], [p.installed_i386], [p.update_x86_64])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.update_x86_64,))
def testUpdatei386Tox86_64ForDependency(self):
p = self.pkgs
res, msg = self.runOperation(['install', 'zsh-utils'], [p.installed_i386], [p.update_x86_64, p.requires_update])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.update_x86_64, p.requires_update))
def testUpdatei386Tox86_64ForDependency2(self):
p = self.pkgs
res, msg = self.runOperation(['update', 'bar'], [p.required, p.installed_i386],
[p.required_updated, p.update_x86_64])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.required_updated, p.update_x86_64))
def testUpdatei386ToMultilib(self):
p = self.pkgs
res, msg = self.runOperation(['update'], [p.installed_i386], [p.update_i386, p.update_x86_64])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.update_i386,))
def testUpdatei386ToMultilibForDependency(self):
p = self.pkgs
res, msg = self.runOperation(['install', 'zsh-utils'], [p.installed_i386], [p.update_i386, p.update_x86_64, p.requires_update])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.update_i386, p.requires_update))
def testUpdatei386ToMultilibForDependency2(self):
p = self.pkgs
res, msg = self.runOperation(['update', 'bar'], [p.required, p.installed_i386],
[p.required_updated, p.update_i386, p.update_x86_64])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.required_updated, p.update_i386))
# x86_64 to X
@@ -188,73 +188,73 @@ class SimpleUpdateTests(OperationsTests):
def testUpdatex86_64Tonoarch(self):
p = self.pkgs
res, msg = self.runOperation(['update'], [p.installed_x86_64], [p.update_noarch,])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.update_noarch,))
def testUpdatex86_64TonoarchForDependency(self):
p = self.pkgs
res, msg = self.runOperation(['install', 'zsh-utils'], [p.installed_x86_64],
[p.update_noarch, p.requires_update])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.update_noarch, p.requires_update))
def testUpdatex86_64TonoarchForDependency2(self):
p = self.pkgs
res, msg = self.runOperation(['update', 'bar'], [p.required, p.installed_x86_64],
[p.required_updated, p.update_noarch])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.required_updated, p.update_noarch))
def testUpdatex86_64Toi386(self):
p = self.pkgs
res, msg = self.runOperation(['update'], [p.installed_x86_64], [p.update_i386,])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.update_i386,))
def testUpdatex86_64Toi386ForDependency(self):
p = self.pkgs
res, msg = self.runOperation(['install', 'zsh-utils'], [p.installed_x86_64],
[p.update_i386, p.requires_update])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.update_i386, p.requires_update))
def testUpdatex86_64Toi386ForDependency2(self):
p = self.pkgs
res, msg = self.runOperation(['update', 'bar'], [p.required, p.installed_x86_64],
[p.required_updated, p.update_i386])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.required_updated, p.update_i386))
def testUpdatex86_64Tox86_64(self):
p = self.pkgs
res, msg = self.runOperation(['update'], [p.installed_x86_64], [p.update_x86_64,])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.update_x86_64,))
def testUpdatex86_64Tox86_64ForDependency(self):
p = self.pkgs
res, msg = self.runOperation(['install', 'zsh-utils'], [p.installed_x86_64],
[p.update_x86_64, p.requires_update])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.update_x86_64, p.requires_update))
def testUpdatex86_64Tox86_64ForDependency2(self):
p = self.pkgs
res, msg = self.runOperation(['update', 'bar'], [p.required, p.installed_x86_64],
[p.required_updated, p.update_x86_64])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.required_updated, p.update_x86_64))
def testUpdatex86_64ToMultilib(self):
p = self.pkgs
res, msg = self.runOperation(['update'], [p.installed_x86_64], [p.update_i386, p.update_x86_64])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.update_x86_64,))
def testUpdatex86_64ToMultilibForDependency(self):
p = self.pkgs
res, msg = self.runOperation(['install', 'zsh-utils'], [p.installed_x86_64],
[p.update_i386, p.update_x86_64, p.requires_update])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.update_x86_64, p.requires_update))
def testUpdatex86_64ToMultilibForDependency2(self):
p = self.pkgs
res, msg = self.runOperation(['update', 'bar'], [p.required, p.installed_x86_64],
[p.required_updated, p.update_i386, p.update_x86_64])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.required_updated, p.update_x86_64))
# multilib to X
@@ -262,24 +262,24 @@ class SimpleUpdateTests(OperationsTests):
def testUpdateMultilibTonoarch(self):
p = self.pkgs
res, msg = self.runOperation(['update'], [p.installed_i386, p.installed_x86_64], [p.update_noarch])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.update_noarch,))
def testUpdateMultilibTonoarchForDependency(self):
p = self.pkgs
res, msg = self.runOperation(['install', 'zsh-utils'], [p.installed_i386, p.installed_x86_64], [p.update_noarch, p.requires_update])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.update_noarch, p.requires_update))
def testUpdateMultilibTonoarchForDependency2(self):
p = self.pkgs
res, msg = self.runOperation(['update', 'bar'], [p.required, p.installed_i386, p.installed_x86_64],
[p.required_updated, p.update_noarch])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.required_updated, p.update_noarch))
def testUpdateMultilibToi386(self):
p = self.pkgs
res, msg = self.runOperation(['update'], [p.installed_i386, p.installed_x86_64], [p.update_i386])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
if new_behavior:
self.assertResult((p.update_i386, p.installed_x86_64))
# self.assertResult((p.update_i386,)) # XXX is this right?
@@ -288,7 +288,7 @@ class SimpleUpdateTests(OperationsTests):
def testUpdateMultilibToi386ForDependency(self):
p = self.pkgs
res, msg = self.runOperation(['install', 'zsh-utils'], [p.installed_i386, p.installed_x86_64], [p.update_i386, p.requires_update])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
if new_behavior:
self.assertResult((p.update_i386, p.installed_x86_64, p.requires_update))
# self.assertResult((p.update_i386, p.requires_update)) # XXX is this right?
@@ -298,13 +298,13 @@ class SimpleUpdateTests(OperationsTests):
p = self.pkgs
res, msg = self.runOperation(['update', 'bar'], [p.required, p.installed_i386, p.installed_x86_64],
[p.required_updated, p.update_i386])
- self.assert_(res=='err', msg)
+ self.assertTrue(res=='err', msg)
self.assertResult((p.required_updated, p.update_i386, p.installed_x86_64))
def testUpdateMultilibTox86_64(self):
p = self.pkgs
res, msg = self.runOperation(['update'], [p.installed_i386, p.installed_x86_64], [p.update_x86_64])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
if new_behavior:
self.assertResult((p.update_x86_64, p.installed_i386))
# self.assertResult((p.update_x86_64,)) # XXX is this right?
@@ -313,7 +313,7 @@ class SimpleUpdateTests(OperationsTests):
def testUpdateMultilibTox86_64ForDependency(self):
p = self.pkgs
res, msg = self.runOperation(['install', 'zsh-utils'], [p.installed_i386, p.installed_x86_64], [p.update_x86_64, p.requires_update])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
if new_behavior:
self.assertResult((p.update_x86_64, p.installed_i386, p.requires_update))
# self.assertResult((p.update_x86_64, p.requires_update)) # XXX is this right?
@@ -323,24 +323,24 @@ class SimpleUpdateTests(OperationsTests):
p = self.pkgs
res, msg = self.runOperation(['update', 'bar'], [p.required, p.installed_i386, p.installed_x86_64],
[p.required_updated, p.update_x86_64])
- self.assert_(res=='err', msg)
+ self.assertTrue(res=='err', msg)
self.assertResult((p.required_updated, p.update_x86_64, p.installed_i386))
def testUpdateMultilibToMultilib(self):
p = self.pkgs
res, msg = self.runOperation(['update'], [p.installed_i386, p.installed_x86_64], [p.update_i386, p.update_x86_64])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.update_i386, p.update_x86_64))
def testUpdateMultilibToMultilibForDependency(self):
p = self.pkgs
res, msg = self.runOperation(['install', 'zsh-utils'], [p.installed_i386, p.installed_x86_64], [p.update_i386, p.update_x86_64, p.requires_update])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.update_i386, p.update_x86_64, p.requires_update))
def testUpdateMultilibToMultilibForDependency2(self):
p = self.pkgs
res, msg = self.runOperation(['update', 'bar'], [p.required, p.installed_i386, p.installed_x86_64],
[p.required_updated, p.update_i386, p.update_x86_64])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p.required_updated, p.update_i386, p.update_x86_64))
def testUpdateNotLatestDep(self):
@@ -352,7 +352,7 @@ class SimpleUpdateTests(OperationsTests):
bar12 = FakePackage('bar', '1', '2', '0', 'i386')
bar21 = FakePackage('bar', '2', '1', '0', 'i386')
res, msg = self.runOperation(['install', 'foo'], [foo11, bar11], [foo12, bar12, bar21])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((foo12, bar12))
def testUpdateBadMultiInstall1(self):
@@ -365,7 +365,7 @@ class SimpleUpdateTests(OperationsTests):
res, msg = self.runOperation(['install', 'foo'],
[foo11, foo12, foo13],
[foo20])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((foo20,))
def testUpdateBadMultiInstall2(self):
@@ -378,7 +378,7 @@ class SimpleUpdateTests(OperationsTests):
res, msg = self.runOperation(['update', 'foo'],
[foo11, foo12, foo13],
[foo20])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((foo20,))
def testUpdateBadMultiInstall3(self):
@@ -391,7 +391,7 @@ class SimpleUpdateTests(OperationsTests):
res, msg = self.runOperation(['update'],
[foo11, foo12, foo13],
[foo20])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((foo20,))
def testUpdateBadMultiInstall4(self):
@@ -407,7 +407,7 @@ class SimpleUpdateTests(OperationsTests):
res, msg = self.runOperation(['update', 'bar'],
[foo11, foo12, foo13, bar11],
[foo20, bar12])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((foo20,bar12))
def testUpdateBadMultiInstall5(self):
@@ -423,7 +423,7 @@ class SimpleUpdateTests(OperationsTests):
res, msg = self.runOperation(['update'],
[foo11, foo12, foo13, bar11],
[foo20, bar12])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((foo20,bar12))
def testUpdateBadMultiInstall6(self):
@@ -439,7 +439,7 @@ class SimpleUpdateTests(OperationsTests):
res, msg = self.runOperation(['update'],
[foo11, foo12, foo13, bar11],
[foo20, bar12])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((bar12,))
def testUpdateBadMultiInstall7(self):
@@ -455,7 +455,7 @@ class SimpleUpdateTests(OperationsTests):
res, msg = self.runOperation(['update', '*'],
[foo11, foo12, foo13, bar11],
[foo20, bar12])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((foo20,bar12))
def testUpdateBadMultiInstall8(self):
@@ -471,7 +471,7 @@ class SimpleUpdateTests(OperationsTests):
res, msg = self.runOperation(['update', '*'],
[foo11, foo12, foo13, bar11],
[foo20, bar12])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((bar12,))
def testUpdateMultiRequiresVersions1(self):
@@ -492,7 +492,7 @@ class SimpleUpdateTests(OperationsTests):
res, msg = self.runOperation(['update', 'perl'],
[pi11, pvi11],
[p12, pv12])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p12,pv12))
def testUpdateMultiRequiresVersions2(self):
@@ -513,7 +513,7 @@ class SimpleUpdateTests(OperationsTests):
res, msg = self.runOperation(['update', 'perl'],
[pi11, pvi11],
[pr11,p12, pvr11,pv12])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p12,pv12))
def testUpdateMultiRequiresVersions3(self):
@@ -534,7 +534,7 @@ class SimpleUpdateTests(OperationsTests):
res, msg = self.runOperation(['update', 'perl-version'],
[pi11, pvi11],
[pr11,p12, pvr11,pv12])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p12,pv12))
def testUpdateMultiRequiresVersions4(self):
@@ -565,7 +565,7 @@ class SimpleUpdateTests(OperationsTests):
res, msg = self.runOperation(['update', 'perl-version'],
[pi11, pbi11, pvi11],
[pr11,p12, pbr11,pb12, pvr11,pv12])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p12,pb12,pv12))
def testUpdateMultiRequiresVersions5(self):
@@ -596,7 +596,7 @@ class SimpleUpdateTests(OperationsTests):
res, msg = self.runOperation(['update', 'perl-blah'],
[pi11, pbi11, pvi11],
[pr11,p12, pbr11,pb12, pvr11,pv12])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p12,pb12,pv12))
def testUpdateMultiRequiresVersions8(self):
@@ -621,7 +621,7 @@ class SimpleUpdateTests(OperationsTests):
[pi11, pvi11],
[pr11,p12, pvr11,pv12,pv13])
# FIXME: This fails ... it tries to install pv13 instead
- self.assert_(res=='err', msg)
+ self.assertTrue(res=='err', msg)
# self.assert_(res=='ok', msg)
# self.assertResult((p12,pv12))
@@ -638,7 +638,7 @@ class SimpleUpdateTests(OperationsTests):
res, msg = self.runOperation(['update', '/path/to/phooy'],
[pi11],
[pr11,p12, py12])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
# FIXME: We'd really like it to be:
# self.assertResult((p12,py12))
# ...but there is no info. you can work this out with.
@@ -658,7 +658,7 @@ class SimpleUpdateTests(OperationsTests):
res, msg = self.runOperation(['update', '/path/to/phooy'],
[pi11],
[pr11,p12, py12])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((p12,py12))
def testInstallFilenamePkgSplit3(self):
@@ -675,7 +675,7 @@ class SimpleUpdateTests(OperationsTests):
res, msg = self.runOperation(['install', '/path/to/phooy'],
[pi12],
[p11, pr12, py12])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((pi12,py12))
def testUpdateMultiArchConflict(self):
@@ -692,7 +692,7 @@ class SimpleUpdateTests(OperationsTests):
res, msg = self.runOperation(['update', 'B'],
[pi1, pi2, pi3],
[pa1, pa2, pa3])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((pa1, pa2, pa3))
# What I was trying to model here is a problem where the Fedora builders
@@ -719,7 +719,7 @@ class SimpleUpdateTests(OperationsTests):
res, msg = self.runOperation(['install', 'A'],
[],
[pa1, pa2, pa3, pa4])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((pa1, pa3))
def testUpdateMultiAvailPkgs2(self):
@@ -735,7 +735,7 @@ class SimpleUpdateTests(OperationsTests):
res, msg = self.runOperation(['install', 'A'],
[],
[pa1, pa2, pa4, pa3])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((pa1, pa3))
def testUpdateMultiAvailPkgs3(self):
@@ -748,7 +748,7 @@ class SimpleUpdateTests(OperationsTests):
res, msg = self.runOperation(['install', 'A'],
[],
[pa1, pa2, pa3, pa4])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((pa1, pa3))
@@ -762,7 +762,7 @@ class SimpleUpdateTests(OperationsTests):
res, msg = self.runOperation(['install', 'A'],
[],
[pa1, pa2, pa4, pa3])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((pa1, pa3))
def testUpdateRLEvince1(self):
@@ -784,7 +784,7 @@ class SimpleUpdateTests(OperationsTests):
res, msg = self.runOperation(['update', 'evince'],
[pi1, pi2, pi3],
[pa1, pa2x, pa2i, pa3])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((pa1, pa2x, pa3))
def testUpdateRLEvince2(self):
@@ -807,7 +807,7 @@ class SimpleUpdateTests(OperationsTests):
res, msg = self.runOperation(['update', 'evince'],
[pi1, pi2, pi3],
[pa1, pa2i, pa2x, pa3])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((pa1, pa2x, pa3))
def testShellRmUp1(self):
@@ -821,7 +821,7 @@ class SimpleUpdateTests(OperationsTests):
),
[pi1],
[pa1], multi_cmds=True)
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((pa1,))
def testShellRmUp2(self):
@@ -837,7 +837,7 @@ class SimpleUpdateTests(OperationsTests):
),
[pi1, pi2],
[pa1, pa2], multi_cmds=True)
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((pa1, pa2))
def testShellRmUp3(self):
@@ -853,7 +853,7 @@ class SimpleUpdateTests(OperationsTests):
),
[pi1, pi2],
[pa1, pa2], multi_cmds=True)
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((pa1, pa2))
def testShellRmUp4(self):
@@ -869,7 +869,7 @@ class SimpleUpdateTests(OperationsTests):
),
[pi1, pi2],
[pa1, pa2], multi_cmds=True)
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((pa1, pa2))
# Test how update-to != update.
@@ -890,7 +890,7 @@ class SimpleUpdateTests(OperationsTests):
res, msg = self.runOperation(['update', 'foo'],
[pkgs['foo11']],
pkgs['all'])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((pkgs['foo20'],))
def testUpdateTo1_2(self):
@@ -898,7 +898,7 @@ class SimpleUpdateTests(OperationsTests):
res, msg = self.runOperation(['update-to', 'foo'],
[pkgs['foo11']],
pkgs['all'])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((pkgs['foo20'],))
def testUpdateTo2_1(self):
@@ -906,7 +906,7 @@ class SimpleUpdateTests(OperationsTests):
res, msg = self.runOperation(['update', 'foo-1-2'],
[pkgs['foo11']],
pkgs['all'])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((pkgs['foo12'],))
def testUpdateTo2_2(self):
@@ -914,7 +914,7 @@ class SimpleUpdateTests(OperationsTests):
res, msg = self.runOperation(['update-to', 'foo-1-2'],
[pkgs['foo11']],
pkgs['all'])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((pkgs['foo12'],))
def testUpdateTo3_1(self):
@@ -922,7 +922,7 @@ class SimpleUpdateTests(OperationsTests):
res, msg = self.runOperation(['update', 'foo-1-2'],
[pkgs['foo12']],
pkgs['all'])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((pkgs['foo20'],))
def testUpdateTo3_2(self):
@@ -931,7 +931,7 @@ class SimpleUpdateTests(OperationsTests):
[pkgs['foo12']],
pkgs['all'])
# Nothing to do...
- self.assert_(res==0, msg)
+ self.assertTrue(res==0, msg)
def testUpdateToProv1_1(self):
@@ -939,7 +939,7 @@ class SimpleUpdateTests(OperationsTests):
res, msg = self.runOperation(['update', 'foobar'],
[pkgs['foo11']],
pkgs['all'])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((pkgs['foo20'],))
def testUpdateToProv1_2(self):
@@ -947,7 +947,7 @@ class SimpleUpdateTests(OperationsTests):
res, msg = self.runOperation(['update-to', 'foobar'],
[pkgs['foo11']],
pkgs['all'])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((pkgs['foo20'],))
def testUpdateToProv2_1(self):
@@ -964,14 +964,14 @@ class SimpleUpdateTests(OperationsTests):
pkgs['all'])
# self.assert_(res=='ok', msg)
# self.assertResult((pkgs['foo12'],))
- self.assert_(res==0, msg)
+ self.assertTrue(res==0, msg)
def testUpdateToProv2_2(self):
pkgs = self._setupUpdateTo()
res, msg = self.runOperation(['update-to', 'foobar = 1-2'],
[pkgs['foo11']],
pkgs['all'])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((pkgs['foo12'],))
def testUpdateToProv3_1(self):
@@ -979,7 +979,7 @@ class SimpleUpdateTests(OperationsTests):
res, msg = self.runOperation(['update', 'foobar = 1-2'],
[pkgs['foo12']],
pkgs['all'])
- self.assert_(res=='ok', msg)
+ self.assertTrue(res=='ok', msg)
self.assertResult((pkgs['foo20'],))
def testUpdateToProv3_2(self):
@@ -988,5 +988,5 @@ class SimpleUpdateTests(OperationsTests):
[pkgs['foo12']],
pkgs['all'])
# Nothing to do...
- self.assert_(res==0, msg)
+ self.assertTrue(res==0, msg)
diff --git a/test/skipbroken-tests.py b/test/skipbroken-tests.py
index 812785a..075e557 100644
--- a/test/skipbroken-tests.py
+++ b/test/skipbroken-tests.py
@@ -64,7 +64,7 @@ class SkipBrokenTests(DepsolveTests):
xpo = self.repoPackage('bar', '1')
xpo.addRequires('foobar', None, (None,None,None))
- self.assertEquals('err', *self.resolveCode(skip=False))
+ self.assertEqual('err', *self.resolveCode(skip=False))
self.assertResult((po,xpo))
def testMissingReqSkip(self):
@@ -77,7 +77,7 @@ class SkipBrokenTests(DepsolveTests):
xpo = self.repoPackage('bar', '1')
xpo.addRequires('foobar', None, (None,None,None))
- self.assertEquals('empty', *self.resolveCode(skip=True))
+ self.assertEqual('empty', *self.resolveCode(skip=True))
self.assertResult([])
def testDepWithMissingReqSkip(self):
@@ -95,7 +95,7 @@ class SkipBrokenTests(DepsolveTests):
xpo1 = self.repoPackage('foobar', '1')
xpo1.addRequires('barfoo', None, (None,None,None))
- self.assertEquals('ok', *self.resolveCode(skip=True))
+ self.assertEqual('ok', *self.resolveCode(skip=True))
self.assertResult([po2])
def testUpdateOldRequired(self):
@@ -113,7 +113,7 @@ class SkipBrokenTests(DepsolveTests):
self.tsInfo.addUpdate(po2, oldpo=po1)
- self.assertEquals('empty', *self.resolveCode(skip=True))
+ self.assertEqual('empty', *self.resolveCode(skip=True))
self.assertResult([ipo, po1])
def testUpdateRequireOld(self):
@@ -131,7 +131,7 @@ class SkipBrokenTests(DepsolveTests):
self.tsInfo.addUpdate(po2, oldpo=po1)
- self.assertEquals('empty', *self.resolveCode(skip=True))
+ self.assertEqual('empty', *self.resolveCode(skip=True))
self.assertResult([ipo, po1])
def testUpdateRequireBoth(self):
@@ -152,7 +152,7 @@ class SkipBrokenTests(DepsolveTests):
self.tsInfo.addUpdate(po2, oldpo=po1)
self.tsInfo.addInstall(por)
- self.assertEquals('empty', *self.resolveCode(skip=True))
+ self.assertEqual('empty', *self.resolveCode(skip=True))
self.assertResult([ipo, po1])
def testEraseDep(self):
@@ -165,7 +165,7 @@ class SkipBrokenTests(DepsolveTests):
ipo2.addRequires('foo', 'EQ', ('0', '1', '0'))
self.tsInfo.addErase(ipo)
- self.assertEquals('ok', *self.resolveCode(skip=True))
+ self.assertEqual('ok', *self.resolveCode(skip=True))
self.assertResult([])
def testEraseReqByUpdateNoSkip(self):
@@ -182,7 +182,7 @@ class SkipBrokenTests(DepsolveTests):
self.tsInfo.addErase(ipo)
self.tsInfo.addUpdate(upo2, oldpo=ipo2)
- self.assertEquals('err', *self.resolveCode(skip=False))
+ self.assertEqual('err', *self.resolveCode(skip=False))
def testEraseReqByUpdateSkip(self):
''' update is skipped, because a req is erased.
@@ -199,7 +199,7 @@ class SkipBrokenTests(DepsolveTests):
self.tsInfo.addUpdate(upo2, oldpo=ipo2)
self.tsInfo.addErase(ipo)
- self.assertEquals('ok', *self.resolveCode(skip=True))
+ self.assertEqual('ok', *self.resolveCode(skip=True))
self.assertResult([])
def testConflictWithInstalled(self):
@@ -215,7 +215,7 @@ class SkipBrokenTests(DepsolveTests):
self.tsInfo.addUpdate(po2, oldpo=po1)
- self.assertEquals('empty', *self.resolveCode(skip=True))
+ self.assertEqual('empty', *self.resolveCode(skip=True))
self.assertResult([ipo, po1])
def testConflictWithInstalledButUpdateExist(self):
@@ -236,7 +236,7 @@ class SkipBrokenTests(DepsolveTests):
self.tsInfo.addUpdate(po2, oldpo=po1)
- self.assertEquals('empty', *self.resolveCode(skip=True))
+ self.assertEqual('empty', *self.resolveCode(skip=True))
self.assertResult([po1,ipo])
def testConflictWithInstalledButUpdateExist2(self):
@@ -258,7 +258,7 @@ class SkipBrokenTests(DepsolveTests):
self.tsInfo.addUpdate(po2, oldpo=po1)
- self.assertEquals('empty', *self.resolveCode(skip=True))
+ self.assertEqual('empty', *self.resolveCode(skip=True))
self.assertResult([po1,ipo])
def testAlternativePackageAvailable(self):
@@ -272,7 +272,7 @@ class SkipBrokenTests(DepsolveTests):
self.tsInfo.addInstall(ipo)
- self.assertEquals('ok', *self.resolveCode(skip=True))
+ self.assertEqual('ok', *self.resolveCode(skip=True))
self.assertResult([ipo, provides2])
def testOnlyOneRequirementAvailable(self):
@@ -284,7 +284,7 @@ class SkipBrokenTests(DepsolveTests):
self.tsInfo.addInstall(ipo)
- self.assertEquals('empty', *self.resolveCode(skip=True))
+ self.assertEqual('empty', *self.resolveCode(skip=True))
self.assertResult([])
def test2PkgReqSameDep(self):
@@ -299,7 +299,7 @@ class SkipBrokenTests(DepsolveTests):
self.tsInfo.addInstall(po1)
self.tsInfo.addInstall(po3)
- self.assertEquals('ok', *self.resolveCode(skip=True))
+ self.assertEqual('ok', *self.resolveCode(skip=True))
self.assertResult([po3,po4])
def testProvidesAndDepsGetRemoved(self):
@@ -310,7 +310,7 @@ class SkipBrokenTests(DepsolveTests):
po2.addRequires('nice')
po2.addRequires('features')
self.tsInfo.addInstall(po2)
- self.assertEquals('empty', *self.resolveCode(skip=True))
+ self.assertEqual('empty', *self.resolveCode(skip=True))
def testSecondStepRequiresUpdate(self):
po1 = self.repoPackage('foo')
@@ -324,7 +324,7 @@ class SkipBrokenTests(DepsolveTests):
ipo = self.instPackage('baz')
upo = self.repoPackage('baz', '2', '1')
- self.assertEquals('empty', *self.resolveCode(skip=True))
+ self.assertEqual('empty', *self.resolveCode(skip=True))
self.assertResult([ipo])
@@ -342,7 +342,7 @@ class SkipBrokenTests(DepsolveTests):
self.tsInfo.addInstall(po1)
- self.assertEquals('empty', *self.resolveCode(skip=True))
+ self.assertEqual('empty', *self.resolveCode(skip=True))
def testDepCycle2(self):
po0 = self.repoPackage('leaf')
@@ -358,7 +358,7 @@ class SkipBrokenTests(DepsolveTests):
self.tsInfo.addInstall(po1)
- self.assertEquals('empty', *self.resolveCode(skip=True))
+ self.assertEqual('empty', *self.resolveCode(skip=True))
def testDepCycle3(self):
po0 = self.repoPackage('leaf')
@@ -374,7 +374,7 @@ class SkipBrokenTests(DepsolveTests):
self.tsInfo.addInstall(po1)
- self.assertEquals('empty', *self.resolveCode(skip=True))
+ self.assertEqual('empty', *self.resolveCode(skip=True))
def testMultiLibUpdate(self):
'''
@@ -389,7 +389,7 @@ class SkipBrokenTests(DepsolveTests):
po2.addRequires('notfound', 'EQ', ('0', '1', '0'))
self.tsInfo.addUpdate(po1, oldpo=ipo1)
self.tsInfo.addUpdate(po2, oldpo=ipo2)
- self.assertEquals('empty', *self.resolveCode(skip=True))
+ self.assertEqual('empty', *self.resolveCode(skip=True))
self.assertResult([ipo1,ipo2])
def testInstReqOldVer1(self):
@@ -414,7 +414,7 @@ class SkipBrokenTests(DepsolveTests):
#FIXME: Find out why this line is needed, it should be auto updated by the solver.
self.tsInfo.addUpdate(po1, oldpo=ipo1) # why is this needed, it should work without ?
self.tsInfo.addUpdate(po3, oldpo=ipo3)
- self.assertEquals('ok', *self.resolveCode(skip=True))
+ self.assertEqual('ok', *self.resolveCode(skip=True))
self.assertResult([po1,po2,po3])
@@ -459,7 +459,7 @@ class SkipBrokenTests(DepsolveTests):
self.tsInfo.addUpdate(d2, oldpo=d1)
self.tsInfo.addUpdate(e2, oldpo=e1)
self.tsInfo.addUpdate(f2, oldpo=f1)
- self.assertEquals('ok', *self.resolveCode(skip=True))
+ self.assertEqual('ok', *self.resolveCode(skip=True))
self.assertResult([a1,b1,c1,d1,e2,f2])
def testBumpedSoName2(self):
@@ -509,7 +509,7 @@ class SkipBrokenTests(DepsolveTests):
self.tsInfo.addUpdate(ur3, oldpo=r3)
self.tsInfo.addUpdate(ur4, oldpo=r4)
- self.assertEquals('empty', *self.resolveCode(skip=True))
+ self.assertEqual('empty', *self.resolveCode(skip=True))
self.assertResult([c1,d1,r1,r2,r3,r4])
def testBumpedSoName3(self):
@@ -558,7 +558,7 @@ class SkipBrokenTests(DepsolveTests):
self.tsInfo.addUpdate(ur3, oldpo=r3)
self.tsInfo.addUpdate(ur4, oldpo=r4)
- self.assertEquals('err', *self.resolveCode(skip=False))
+ self.assertEqual('err', *self.resolveCode(skip=False))
def testBumpedSoNameMultiArch(self):
"""
@@ -612,7 +612,7 @@ class SkipBrokenTests(DepsolveTests):
self.tsInfo.addUpdate(ur3, oldpo=r3)
self.tsInfo.addUpdate(ur4, oldpo=r4)
- self.assertEquals('empty', *self.resolveCode(skip=True))
+ self.assertEqual('empty', *self.resolveCode(skip=True))
self.assertResult([c1,d1,r1,r2,r3,r4])
def testDualPackageUpdate(self):
@@ -629,7 +629,7 @@ class SkipBrokenTests(DepsolveTests):
u1.addRequires("notfound")
self.tsInfo.addUpdate(u1, oldpo=i1)
self.tsInfo.addUpdate(u1, oldpo=i2)
- self.assertEquals('empty', *self.resolveCode(skip=True))
+ self.assertEqual('empty', *self.resolveCode(skip=True))
self.assertResult([i1,i2])
def testDowngrade1(self):
@@ -646,7 +646,7 @@ class SkipBrokenTests(DepsolveTests):
d1 = self.repoPackage('foo', '1.1')
d1.addProvides('foolib', 'EQ', ('0', '1', '0'))
self.tsInfo.addDowngrade(d1, oldpo=i1)
- self.assertEquals('empty', *self.resolveCode(skip=True))
+ self.assertEqual('empty', *self.resolveCode(skip=True))
self.assertResult([i1, i2])
@@ -669,7 +669,7 @@ class SkipBrokenTests(DepsolveTests):
u1 = self.repoPackage('iptables','1.4.6', arch='x86_64')
u1.addFile("/usr/lib64/libxtables.so.4")
self.tsInfo.addUpdate(u1, oldpo=i1)
- self.assertEquals('empty', *self.resolveCode(skip=True))
+ self.assertEqual('empty', *self.resolveCode(skip=True))
self.assertResult([i1,i2])
def testTransactionOutput(self):
@@ -700,7 +700,7 @@ class SkipBrokenTests(DepsolveTests):
u7.addProvides('foo6', 'EQ', ('0', '2', '0'))
self.tsInfo.addInstall(i1)
self.tsInfo.addUpdate(u7, oldpo=i7)
- self.assertEquals('ok', *self.resolveCode(skip=True))
+ self.assertEqual('ok', *self.resolveCode(skip=True))
# uncomment this line and the test will fail and you can see the output
# self.assertResult([i1])
@@ -731,7 +731,7 @@ class SkipBrokenTests(DepsolveTests):
u4 = self.repoString('1:kdepim-runtime-4.4.10-2.fc15.x86_64')
self.tsInfo.addUpdate(u4, oldpo=i4)
members.append(u4)
- self.assertEquals('ok', *self.resolveCode(skip=True))
+ self.assertEqual('ok', *self.resolveCode(skip=True))
self.assertResult(members)
def test_skipbroken_001(self):
@@ -750,7 +750,7 @@ class SkipBrokenTests(DepsolveTests):
ux1.addFile("/usr/lib/.libssl.so.1.0.0b.hmac")
self.tsInfo.addUpdate(ux1, oldpo=ix1)
members.append(ix1)
- self.assertEquals('empty', *self.resolveCode(skip=True))
+ self.assertEqual('empty', *self.resolveCode(skip=True))
self.assertResult(members)
@@ -775,7 +775,7 @@ class SkipBrokenTests(DepsolveTests):
u1 = self.repoString('afoobar-0.4.14-1.fc14.noarch')
self.tsInfo.addUpdate(u1, oldpo=i1)
members.append(u1)
- self.assertEquals('ok', *self.resolveCode(skip=True))
+ self.assertEqual('ok', *self.resolveCode(skip=True))
self.assertResult(members)
def test_skipbroken_003(self):
@@ -807,7 +807,7 @@ class SkipBrokenTests(DepsolveTests):
u1 = self.repoString('zfoobar-0.4.14-1.fc14.noarch')
self.tsInfo.addUpdate(u1, oldpo=i1)
members.append(u1)
- self.assertEquals('ok', *self.resolveCode(skip=True))
+ self.assertEqual('ok', *self.resolveCode(skip=True))
self.assertResult(members)
diff --git a/test/testbase.py b/test/testbase.py
index d0f22be..89161a2 100644
--- a/test/testbase.py
+++ b/test/testbase.py
@@ -6,7 +6,7 @@ import settestpath
import logging
import yum.logginglevels as logginglevels
-new_behavior = "NEW_BEHAVIOR" in os.environ.keys()
+new_behavior = "NEW_BEHAVIOR" in list(os.environ.keys())
from yum import YumBase
from yum import transactioninfo
@@ -122,9 +122,9 @@ class FakePackage(packages.YumAvailablePackage):
def __init__(self, name, version='1.0', release='1', epoch='0', arch='noarch', repo=None):
if repo is None:
repo = FakeRepo()
- print "creating empty repo for %s-%s:%s-%s.%s " % (name, epoch,
+ print("creating empty repo for %s-%s:%s-%s.%s " % (name, epoch,
version, release,
- arch)
+ arch))
packages.YumAvailablePackage.__init__(self, repo)
self.name = name
@@ -326,7 +326,7 @@ class FakeRpmDb(packageSack.PackageSack):
installedUnresolvedFileRequires.add(name)
fileRequires = set()
- for fnames in installedFileRequires.itervalues():
+ for fnames in installedFileRequires.values():
fileRequires.update(fnames)
installedFileProviders = {}
for fname in fileRequires:
@@ -361,7 +361,7 @@ class FakeRpmDb(packageSack.PackageSack):
# convert flags & version for unversioned reqirements
if not version:
version=(None, None, None)
- if type(version) in (str, type(None), unicode):
+ if type(version) in (str, type(None), str):
version = rpmUtils.miscutils.stringToVersion(version)
if flags == '0':
flags=None
diff --git a/test/transactiontests.py b/test/transactiontests.py
index 74a7666..da2de69 100644
--- a/test/transactiontests.py
+++ b/test/transactiontests.py
@@ -162,4 +162,4 @@ class TransactionDataTests(unittest.TestCase):
def dumpTsInfo(self):
for txmbr in self.tsInfo:
- print txmbr
+ print(txmbr)
diff --git a/test/yum-leak-test.py b/test/yum-leak-test.py
index 760b770..2a1933a 100755
--- a/test/yum-leak-test.py
+++ b/test/yum-leak-test.py
@@ -17,14 +17,14 @@ def out_mem(pid):
data[1] = data[1][:-3]
ps[data[0].strip().lower()] = data[1].strip()
if 'vmrss' in ps and 'vmsize' in ps:
- print "* Memory : %5s RSS (%5sB VSZ)" % \
+ print("* Memory : %5s RSS (%5sB VSZ)" % \
(format_number(int(ps['vmrss']) * 1024),
- format_number(int(ps['vmsize']) * 1024))
+ format_number(int(ps['vmsize']) * 1024)))
-print "Running:", yum.__version__
+print("Running:", yum.__version__)
def _leak_tst_yb():
- print "Doing YumBase leak test. "
+ print("Doing YumBase leak test. ")
out_mem(os.getpid())
while True:
yb = yum.YumBase()
@@ -38,41 +38,41 @@ def _leak_tst_yb():
if False:
del yb
- print len(gc.garbage)
+ print(len(gc.garbage))
if gc.garbage:
- print gc.garbage[0]
- print gc.get_referrers(gc.garbage[0])
+ print(gc.garbage[0])
+ print(gc.get_referrers(gc.garbage[0]))
# print "DBG:", gc.get_referrers(yb)
def _leak_tst_cl():
- print "Doing closeRpmDB and .up test. "
+ print("Doing closeRpmDB and .up test. ")
yb = yum.YumBase()
yb.preconf.debuglevel = 0
yb.preconf.errorlevel = 0
yb.repos.setCacheDir(yum.misc.getCacheDir())
while True:
out_mem(os.getpid())
- print "up:",
+ print("up:", end=' ')
yb.up
- print "done"
+ print("done")
out_mem(os.getpid())
- print "rpmdb pkgs:",
+ print("rpmdb pkgs:", end=' ')
yb.rpmdb.returnPackages()
- print "done"
+ print("done")
out_mem(os.getpid())
- print "pkgSack pkgs:",
+ print("pkgSack pkgs:", end=' ')
yb.pkgSack.returnPackages()
- print "done"
+ print("done")
out_mem(os.getpid())
- print "close:",
+ print("close:", end=' ')
yb.closeRpmDB()
- print "done"
+ print("done")
def _leak_tst_ir():
- print "Doing install/remove leak test. "
+ print("Doing install/remove leak test. ")
def _init():
yb = cli.YumBaseCli() # Need doTransaction() etc.
@@ -88,14 +88,14 @@ def _leak_tst_ir():
out_mem(os.getpid())
def _run(yb):
- print " Run"
+ print(" Run")
(code, msgs) = yb.buildTransaction()
if code == 1:
- print "ERROR:", core, msgs
+ print("ERROR:", core, msgs)
sys.exit(1)
returnval = yb.doTransaction()
if returnval != 0: # We could allow 1 too, but meh.
- print "ERROR:", returnval
+ print("ERROR:", returnval)
sys.exit(1)
yb.closeRpmDB()
@@ -104,14 +104,14 @@ def _leak_tst_ir():
if True:
yb = _init()
out_mem(os.getpid())
- print " Install:", sys.argv[1:]
+ print(" Install:", sys.argv[1:])
for pat in sys.argv[1:]:
yb.install(pattern=pat)
out_mem(os.getpid())
_run(yb)
out_mem(os.getpid())
- print " Remove:", sys.argv[1:]
+ print(" Remove:", sys.argv[1:])
for pat in sys.argv[1:]:
yb.remove(pattern=pat)
out_mem(os.getpid())