#495 Fix #381 - just compare the two sets (w/-o any ordering)
Merged 7 years ago by fivaldi. Opened 7 years ago by fivaldi.
fivaldi/fm-orchestrator fivaldi_fix_tests  into  master

@@ -96,9 +96,8 @@ 

          module_build_service.utils.format_mmd(mmd, scmurl)

  

          # Make sure all the commit hashes were properly set on the RPMs

-         for i, pkg in enumerate(mmd.components.rpms.values()):

-             self.assertEqual(

-                 pkg.ref, hashes_returned[i])

+         mmd_pkg_refs = [pkg.ref for pkg in mmd.components.rpms.values()]

+         self.assertEqual(set(mmd_pkg_refs), set(hashes_returned))

There is also assertItemsEqual which does the same thing but gives (slightly) nicer assertion failure messages.

  

          self.assertEqual(mmd.buildrequires, {'base-runtime': 'master'})

          xmd = {

file modified
+1 -1
@@ -15,7 +15,7 @@ 

      nose

      pytest

      vcrpy

- commands = py.test

+ commands = py.test {posargs}

Just a bonus line not related to the PR. :-)

  

  [testenv:coverage]

  basepython = python2

no initial comment

rebased

7 years ago

Just a bonus line not related to the PR. :-)

Pull-Request has been merged by fivaldi

7 years ago

There is also assertItemsEqual which does the same thing but gives (slightly) nicer assertion failure messages.