Adam Litke has posted comments on this change. Change subject: storagefakelib: Add FakeResourceManager ......................................................................
Patch Set 2: (4 comments) 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. Done 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. Done 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. Done 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 Done 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: Adam Litke <ali...@redhat.com> Gerrit-Reviewer: Ala Hino <ah...@redhat.com> Gerrit-Reviewer: Amit Aviram <aavi...@redhat.com> Gerrit-Reviewer: Daniel Erez <de...@redhat.com> Gerrit-Reviewer: Freddy Rolland <froll...@redhat.com> Gerrit-Reviewer: Greg Padgett <gpadg...@redhat.com> Gerrit-Reviewer: Idan Shaby <ish...@redhat.com> Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Liron Aravot <lara...@redhat.com> Gerrit-Reviewer: Maor Lipchuk <mlipc...@redhat.com> Gerrit-Reviewer: Nir Soffer <nsof...@redhat.com> Gerrit-Reviewer: Tal Nisan <tni...@redhat.com> Gerrit-Reviewer: Vered Volansky <vvola...@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