Nir Soffer has posted comments on this change. Change subject: virt: common handling of exceptions ......................................................................
Patch Set 8: (3 comments) https://gerrit.ovirt.org/#/c/54664/8/tests/api_response_test.py File tests/api_response_test.py: Line 24: Line 25: from testlib import VdsmTestCase as TestCaseBase Line 26: Line 27: Line 28: class ResponseTests(TestCaseBase): Can you name the class TestResponse? This name is automatically detected by py.test, even if you don't subclass from VdsmTestCase. We can do these changes later, but when adding new tests I think we should use this style to save work later. Line 29: Line 30: def setUp(self): Line 31: self.vm = FakeVM() Line 32: Line 36: Line 37: def test_success_with_return_dict(self): Line 38: vmList = ['foobar'] Line 39: res = self.vm.succeed_with_return({'vmList': vmList}) Line 40: self.assertEquals(response.is_error(res), False) This is much easier to parse like this. Line 41: self.assertEquals(res['vmList'], vmList) Line 42: Line 43: def test_success_with_wrong_return(self): Line 44: vmList = ['foobar'] Line 72: def succeed(self): Line 73: pass Line 74: Line 75: @api.method Line 76: def succeed_with_return(self, ret): What about testing kwargs? Not sure that we need them, I think the bridge always call with positional args, but I did not test this. -- To view, visit https://gerrit.ovirt.org/54664 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic186dc8fa062d8b3789c6057bba68fbbc23f311b Gerrit-PatchSet: 8 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Francesco Romani <[email protected]> Gerrit-Reviewer: Adam Litke <[email protected]> Gerrit-Reviewer: Amit Aviram <[email protected]> Gerrit-Reviewer: Dan Kenigsberg <[email protected]> Gerrit-Reviewer: Francesco Romani <[email protected]> Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Nir Soffer <[email protected]> Gerrit-Reviewer: Piotr Kliczewski <[email protected]> Gerrit-Reviewer: Vinzenz Feenstra <[email protected]> Gerrit-Reviewer: gerrit-hooks <[email protected]> Gerrit-HasComments: Yes _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
