Nir Soffer has posted comments on this change.

Change subject: tests: Add simple mocking library
......................................................................


Patch Set 1:

(1 comment)

....................................................
Commit Message
Line 11: environment for running.
Line 12: 
Line 13: MockCallable is using the record and play aprroach; After a mock is
Line 14: created, you tell it what calls to expect. If needed, you may specify
Line 15: the result of each call. The result may any return value or rasing an
What you suggest, adding logic to return different output based on input, is 
actually to create a stub. Mocks contain no logic, and the test code control 
the input and output.

The problem with stub is they may be more complex then the code they test, and 
you need to add test for each stub to make sure it work as you think :-)
Line 16: exception.
Line 17: 
Line 18: When the mock is called by the code under test, it will raise a
Line 19: MockError as soon as it is called with unexpected arguments or keyword


-- 
To view, visit http://gerrit.ovirt.org/21155
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ia5d874f553b6a983652ed745d7d8554716e7a15e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Douglas Schilling Landgraf <[email protected]>
Gerrit-Reviewer: Nir Soffer <[email protected]>
Gerrit-Reviewer: Saggi Mizrahi <[email protected]>
Gerrit-Reviewer: Sergey Gotliv <[email protected]>
Gerrit-Reviewer: Yaniv Bronhaim <[email protected]>
Gerrit-Reviewer: mooli tayer <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to