[Yum-devel] [PATCH 2/7] Add more makelists tests.
Paul Nasrat
pnasrat at gmail.com
Tue Jul 16 16:19:32 UTC 2013
On 16 July 2013 09:43, James Antill <james at and.org> wrote:
> ---
> test/simpleupdatetests.py | 102
> +++++++++++++++++++++++++++++++++++++++++++--
> 1 files changed, 98 insertions(+), 4 deletions(-)
>
> diff --git a/test/simpleupdatetests.py b/test/simpleupdatetests.py
> index c485992..63b7e62 100644
> --- a/test/simpleupdatetests.py
> +++ b/test/simpleupdatetests.py
> @@ -1080,7 +1080,7 @@ class SimpleUpdateTests(OperationsTests):
> self.assert_(res=='ok', msg)
> self.assertResult((pax2, pai2, pa2))
>
> - def testUpdateForDeps(self):
> + def testUpdateForDeps0(self):
>
Personal bug bear on naming - Deps0 tells me nothing about what this is
testing maybe more descriptive names - eg - testUpdateForDeps_userListed.
foo11 = FakePackage('foo', '1', '1', '0', 'i386')
> foo11.addRequires('bar', 'EQ', ('0', '1', '1'))
>
> @@ -1097,7 +1097,101 @@ class SimpleUpdateTests(OperationsTests):
> self.assertResult((foo12, bar12))
>
> self.tsInfo.makelists()
> - for txmbr in self.tsInfo:
> - print txmbr,
> - print txmbr.reason
>
Yeah sorry for leaving the debugging prints in the original patch.
> self.assertEquals([], self.tsInfo.depupdated)
> +
> + def _testUpdateForDeps_setup(self):
> + foo11 = FakePackage('foo', '1', '1', '0', 'i386')
> + foo11.addRequires('bar', 'EQ', ('0', '1', '1'))
> +
> + foo12 = FakePackage('foo', '1', '2', '0', 'i386')
> + foo12.addRequires('bar', 'EQ', ('0', '1', '2'))
> +
> + bar11 = FakePackage('bar', '1', '1', '0', 'i386')
> + bar11.addRequires('foo', 'EQ', ('0', '1', '1'))
> +
> + bar12 = FakePackage('bar', '1', '2', '0', 'i386')
> + bar12.addRequires('foo', 'EQ', ('0', '1', '2'))
> +
> + return foo11, foo12, bar11, bar12
> +
> + def testUpdateForDeps1(self):
> + foo11, foo12, bar11, bar12 = self._testUpdateForDeps_setup()
> +
> + res, msg = self.runOperation(['install', 'foo', 'bar'], [foo11,
> bar11], [foo12, bar12])
> +
> + self.assert_(res=='ok', msg)
> + self.assertResult((foo12, bar12))
> +
> + self.tsInfo.makelists()
> + self.assertEquals([], self.tsInfo.depupdated)
> +
> + def testUpdateForDeps2(self):
> + foo11, foo12, bar11, bar12 = self._testUpdateForDeps_setup()
> +
> + res, msg = self.runOperation(['upgrade', 'foo', 'bar'], [foo11,
> bar11], [foo12, bar12])
> +
> + self.assert_(res=='ok', msg)
> + self.assertResult((foo12, bar12))
> +
> + self.tsInfo.makelists()
> + self.assertEquals([], self.tsInfo.depupdated)
> +
> + def testUpdateForDeps3(self):
> + foo11, foo12, bar11, bar12 = self._testUpdateForDeps_setup()
> + bar11.yumdb_info.reason = 'dep'
> +
> + res, msg = self.runOperation(['upgrade', 'foo', 'bar'], [foo11,
> bar11], [foo12, bar12])
> +
> + self.assert_(res=='ok', msg)
> + self.assertResult((foo12, bar12))
> +
> + self.tsInfo.makelists()
> + self.assertEquals([], self.tsInfo.depupdated)
> +
> + def testUpdateForDeps4(self):
> + foo11, foo12, bar11, bar12 = self._testUpdateForDeps_setup()
> + foo11.yumdb_info.reason = 'user'
> + bar11.yumdb_info.reason = 'dep'
> +
> + res, msg = self.runOperation(['upgrade', 'foo'], [foo11, bar11],
> [foo12, bar12])
> +
> + self.assert_(res=='ok', msg)
> + self.assertResult((foo12, bar12))
> +
> + self.tsInfo.makelists()
> + self.assertEquals([bar12], self.tsInfo.depupdated)
> +
> + def testUpdateForDeps5(self):
> + foo11, foo12, bar11, bar12 = self._testUpdateForDeps_setup()
> + foo11.yumdb_info.reason = 'user'
> + bar11.yumdb_info.reason = 'dep'
> +
> + res, msg = self.runOperation(['upgrade', 'bar'], [foo11, bar11],
> [foo12, bar12])
> +
> + self.assert_(res=='ok', msg)
> + self.assertResult((foo12, bar12))
> +
> + self.tsInfo.makelists()
> + self.assertEquals([foo12], self.tsInfo.depupdated)
> +
> + def testUpdateForDeps6(self):
> + foo11, foo12, bar11, bar12 = self._testUpdateForDeps_setup()
> +
> + res, msg = self.runOperation(['install', 'foo'], [], [foo11,
> bar11, foo12, bar12])
> +
> + self.assert_(res=='ok', msg)
> + self.assertResult((foo12, bar12))
> +
> + self.tsInfo.makelists()
> + self.assertEquals([bar12], self.tsInfo.depinstalled)
> +
> + def testUpdateForDeps7(self):
> + foo11, foo12, bar11, bar12 = self._testUpdateForDeps_setup()
> +
> + res, msg = self.runOperation(['install', 'bar'], [], [foo11,
> bar11, foo12, bar12])
> +
> + self.assert_(res=='ok', msg)
> + self.assertResult((foo12, bar12))
> +
> + self.tsInfo.makelists()
> + self.assertEquals([foo12], self.tsInfo.depinstalled)
> --
> 1.7.7.6
>
> _______________________________________________
> Yum-devel mailing list
> Yum-devel at lists.baseurl.org
> http://lists.baseurl.org/mailman/listinfo/yum-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.baseurl.org/pipermail/yum-devel/attachments/20130716/2b4a69fb/attachment-0001.html>
More information about the Yum-devel
mailing list