[rhinstaller/blivet/pulls/155 master] Sort the lists before comparing because coversion to set reverses order in Python3
atodorov
installerbot-noreply at redhat.com
Wed Jun 10 13:46:03 UTC 2015
> @@ -18,9 +18,12 @@ def testPackages(self):
> dev = MDRaidArrayDevice("dev", level="raid1", parents=[dev1,dev2])
> luks = LUKSDevice("luks", parents=[dev])
> packages = luks.packages
> + packages.sort() # sort due to blivet/issues/154
>
> # no duplicates in list of packages
> - self.assertListEqual(packages, list(set(packages)))
> + l = list(set(packages))
> + l.sort() # sort due to blivet/issues/154
> + self.assertListEqual(packages, l)
We have a list, not set. We convert it to set to remove all duplicates, then back to list to compare it to the original. Now this can be done in other ways as #154 suggests, but there aren't two sets which you can compare to begin with.
--
To view this pull request on github, visit https://github.com/rhinstaller/blivet/pull/155#discussion_r32118175
More information about the anaconda-patches
mailing list