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

Proposed by Mike Pontillo on 2016-06-13
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 2016-06-13 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.
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
1=== modified file 'uvtool/tests/test_simplestreams.py'
2--- uvtool/tests/test_simplestreams.py 2014-02-19 14:51:02 +0000
3+++ uvtool/tests/test_simplestreams.py 2016-06-13 20:07:57 +0000
4@@ -61,7 +61,10 @@
5 # least once by uvtool.libvirt.simplestreams directly. This is more of
6 # an assertion about the test being correct than part of the test
7 # itself.
8- libvirt.assert_has_calls(mock.call.open(u'qemu:///system'))
9+ libvirt.assert_has_calls([
10+ mock.call.registerErrorHandler(mock.ANY, None),
11+ mock.call.open(u'qemu:///system')
12+ ])
13
14 # create_volume_from_fobj should have been called exactly once to
15 # create the volume with the name that we expect

Subscribers

People subscribed via source and target branches