Merge lp:~mpontillo/uvtool/fix-unit-tests-libvirt-register-error-handler into lp:~uvtool-dev/uvtool/trunk

Proposed by Mike Pontillo
Status: Merged
Merge reported by: Robie Basak
Merged at revision: not available
Proposed branch: lp:~mpontillo/uvtool/fix-unit-tests-libvirt-register-error-handler
Merge into: lp:~uvtool-dev/uvtool/trunk
Diff against target: 15 lines (+4/-1)
1 file modified
uvtool/tests/test_simplestreams.py (+4/-1)
To merge this branch: bzr merge lp:~mpontillo/uvtool/fix-unit-tests-libvirt-register-error-handler
Reviewer Review Type Date Requested Status
uvtool development Pending
Review via email: mp+297237@code.launchpad.net

Commit message

Fix unit tests to include libvirt.registerErrorHandler() call.

Description of the change

It looks like unit tests were broken as part of the fix for bug #1228231.

In order to get the unit tests passing (as specified in debian/rules) I had to make this change.

To post a comment you must log in.
Revision history for this message
Robie Basak (racb) wrote :

Fixed in git master, thanks. Rather than adding the registerErrorHandler call, I just put the existing call in a list, which makes assert_has_calls work correctly. I was intending to test that "open" was called at least once, rather than the entire set.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'uvtool/tests/test_simplestreams.py'
--- uvtool/tests/test_simplestreams.py 2014-02-19 14:51:02 +0000
+++ uvtool/tests/test_simplestreams.py 2016-06-13 20:07:57 +0000
@@ -61,7 +61,10 @@
61 # least once by uvtool.libvirt.simplestreams directly. This is more of61 # least once by uvtool.libvirt.simplestreams directly. This is more of
62 # an assertion about the test being correct than part of the test62 # an assertion about the test being correct than part of the test
63 # itself.63 # itself.
64 libvirt.assert_has_calls(mock.call.open(u'qemu:///system'))64 libvirt.assert_has_calls([
65 mock.call.registerErrorHandler(mock.ANY, None),
66 mock.call.open(u'qemu:///system')
67 ])
6568
66 # create_volume_from_fobj should have been called exactly once to69 # create_volume_from_fobj should have been called exactly once to
67 # create the volume with the name that we expect70 # create the volume with the name that we expect

Subscribers

People subscribed via source and target branches