Nir Soffer has posted comments on this change.

Change subject: imagetickets: add tests
......................................................................


Patch Set 10:

(2 comments)

https://gerrit.ovirt.org/#/c/52900/10/tests/imagetickets_test.py
File tests/imagetickets_test.py:

Line 121: 
Line 122:     @MonkeyPatch(imagetickets, 'uhttp', FakeUHTTP())
Line 123:     def test_res_header_error(self):
Line 124:         imagetickets.uhttp.response = \
Line 125:             FakeResponse(status=300, headers={"content-length": 
"invalid"})
Please avoid \ - use this format:

    imagetickets.uhttp.response = FakeResponse(
        status=300, headers={"content-length": "invalid"})

Same for other tests using this pattern.
Line 126:         with self.assertRaises(se.ImageDaemonError):
Line 127:             imagetickets.remove_ticket("uuid")
Line 128: 
Line 129:     @MonkeyPatch(imagetickets, 'uhttp', FakeUHTTP())


Line 136:     @MonkeyPatch(imagetickets, 'uhttp', FakeUHTTP())
Line 137:     def test_image_daemon_error_ret(self):
Line 138:         imagetickets.uhttp.response = \
Line 139:             FakeResponse(status=300,
Line 140:                          data=u'{"image_daemon_message":' 
u'"content"}')
This should be one string - it works because Python joins multiple strings, 
like C, but it is confusing.

    u'{"image_daemon_message":"content"}'
Line 141:         try:
Line 142:             imagetickets.remove_ticket("uuid")
Line 143:         except se.ImageDaemonError as e:
Line 144:             self.assertTrue("image_daemon_message=content" in e.value)


-- 
To view, visit https://gerrit.ovirt.org/52900
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I2728851a91529ec35501f423d9a798af961fb82a
Gerrit-PatchSet: 10
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Amit Aviram <aavi...@redhat.com>
Gerrit-Reviewer: Amit Aviram <aavi...@redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Liron Aravot <lara...@redhat.com>
Gerrit-Reviewer: Nir Soffer <nsof...@redhat.com>
Gerrit-Reviewer: gerrit-hooks <automat...@ovirt.org>
Gerrit-HasComments: Yes
_______________________________________________
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to