Nir Soffer has posted comments on this change.

Change subject: tests: Generalize sdm_indirection_tests
......................................................................


Patch Set 3: Code-Review+2

(2 comments)

https://gerrit.ovirt.org/#/c/46259/3/tests/sdm_indirection_tests.py
File tests/sdm_indirection_tests.py:

Line 293:         self.target_name = target_name
Line 294: 
Line 295:     def check(self, fn, args, result):
Line 296:         target = getattr(self.source_instance, self.target_name)
Line 297:         getattr(self.source_instance, fn)(*args)
These lines should be reversed - we should get target only when we need it. 
Feel free to change if you happen to post another version.
Line 298:         return target.__recording__ == result
Line 299: 
Line 300:     def check_call(self, fn, nr_args=0):
Line 301:         args = tuple(range(nr_args))


Line 303: 
Line 304:     def check_classmethod_call(self, fn, nr_args=0):
Line 305:         args = tuple(range(nr_args))
Line 306:         target = getattr(self.source_instance, self.target_name)
Line 307:         getattr(self.source_instance, fn)(*args)
Same, get target just before you use it.
Line 308:         return target.get_classmethod_calls() == [(fn, args)]
Line 309: 
Line 310: 
Line 311: @expandPermutations


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Icb68cb27d4e36c22f74a1cc445f38bea4d0ce4da
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Adam Litke <[email protected]>
Gerrit-Reviewer: Adam Litke <[email protected]>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <[email protected]>
Gerrit-Reviewer: [email protected]
Gerrit-HasComments: Yes
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to