Nir Soffer has posted comments on this change. Change subject: storagefakelib: Add FakeResourceManager ......................................................................
Patch Set 2: Code-Review-1 (4 comments) Partial review, looks good https://gerrit.ovirt.org/#/c/50340/2/tests/storagefakelib.py File tests/storagefakelib.py: Line 220: Line 221: Line 222: class FakeResourceManager(object): Line 223: def __init__(self): Line 224: self.__calls__ = [] If we @record both method, we can eliminate init. Line 225: Line 226: @contextmanager Line 227: def acquireResource(self, *args, **kwargs): Line 228: try: Line 222: class FakeResourceManager(object): Line 223: def __init__(self): Line 224: self.__calls__ = [] Line 225: Line 226: @contextmanager Try to @record this. Line 227: def acquireResource(self, *args, **kwargs): Line 228: try: Line 229: self.__calls__.append(('acquireResource', args, kwargs)) Line 230: yield Line 225: Line 226: @contextmanager Line 227: def acquireResource(self, *args, **kwargs): Line 228: try: Line 229: self.__calls__.append(('acquireResource', args, kwargs)) If @recording works - this is unneeded. Line 230: yield Line 231: finally: Line 232: self.releaseResource(*args, **kwargs) Line 233: Line 229: self.__calls__.append(('acquireResource', args, kwargs)) Line 230: yield Line 231: finally: Line 232: self.releaseResource(*args, **kwargs) Line 233: This can be @recorded Line 234: def releaseResource(self, *args, **kwargs): -- To view, visit https://gerrit.ovirt.org/50340 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0302b48d984ce7eb8ce2326ab4bb033430c032f9 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Adam Litke <ali...@redhat.com> Gerrit-Reviewer: Jenkins CI 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