Change in vdsm[master]: contrib: schema converter

piotr.kliczewski at gmail.com piotr.kliczewski at gmail.com
Fri Apr 22 07:12:13 UTC 2016


Piotr Kliczewski has posted comments on this change.

Change subject: contrib: schema converter
......................................................................


Patch Set 35:

(9 comments)

https://gerrit.ovirt.org/#/c/52864/35/lib/api/json_schema.py
File lib/api/json_schema.py:

Line 1: #!/usr/bin/env python
Line 2: #
> why do you change the name of this file?
No, good reason. Will change it as you suggested in other patch.
Line 3: # Copyright (C) 2012 Adam Litke, IBM Corporation
Line 4: #
Line 5: # This program is free software; you can redistribute it and/or modify
Line 6: # it under the terms of the GNU General Public License as published by


https://gerrit.ovirt.org/#/c/52864/35/tests/schemaValidationTest.py
File tests/schemaValidationTest.py:

PS35, Line 216:              if name not in params:
              :                     raise Exception("parameters do not match for %s.%s"
              :                                     % (command, method))
> why not 
Good idea, will change.


PS35, Line 221:         path = schemaapi.find_schema()
              :         gluster_path = schemaapi.find_schema('vdsm-api-gluster')
              :         cache = schemaapi.Schema([path, gluster_path])
> maybe move into setUp() and set cache as instance variable?
Done


PS35, Line 228:             if not y_ret:
              :                 if ret:
              :                     raise Exception("Return value do not match")
              :                 continue
> self.assertTrue(ret and y_ret)
Done


PS35, Line 234:                 if not isinstance(ret, list):
              :                     raise Exception("Return expected to be list")
> self.assertTrue(isinstance(ret, list))
Done


PS35, Line 242:             if ret_type != self.swap_types(ret):
              :                 raise Exception("Return type do not match")
> self.assertEquals(ret_type, swap_types(ret))
Done


PS35, Line 245: test_types
> same as previous methods, in each place you raise Exception
Done


PS35, Line 285: with self.assertRaises(schemaapi.MethodNotFound):
> we prefer:
Done


PS35, Line 293: assertRaises
> same
Done


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I3921cebb7f550f63849f3bc5c80636b6e9495c92
Gerrit-PatchSet: 35
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Piotr Kliczewski <piotr.kliczewski at gmail.com>
Gerrit-Reviewer: Adam Litke <alitke at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Darshan N <dnarayan at redhat.com>
Gerrit-Reviewer: Edward Haas <edwardh at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Polednik <mpolednik at redhat.com>
Gerrit-Reviewer: Martin Sivák <msivak at redhat.com>
Gerrit-Reviewer: Milan Zamazal <mzamazal at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Oved Ourfali <oourfali at redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski at gmail.com>
Gerrit-Reviewer: Sahina Bose <sabose at redhat.com>
Gerrit-Reviewer: Vinzenz Feenstra <vfeenstr at redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list