Saggi Mizrahi has posted comments on this change.

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


Patch Set 1:

The tests you linked are a bunch of tests that test nothing.
You have a method that all it does is call lvs with certain parameters in order 
to achieve some effect.
You test that you pass said parameters. Which doesn't need testing as we can 
clearly see that in the file.
And fabricated the response. So the test works.
Lets just agree to remove the parameter checking as it's completely obsolete 
and just say you want to run the function and test it's side effects.
doing xxx = lambda vg: false
would have achieved the same results.

Back to my original point. Mocks that do nothing. Mocks that don't hold state. 
can just be lambdas and inner functions in python. No need for any 
infrastructure.

Anything more complicated than that.
Say a real LVM mock. Would need it's own class anyway.

To reiterate, if tomorrow I change it so that I deactivate the LVs using sysfs 
(let's say it is suddenly possible). All of your tests fail.

You don't do mock tests to these kind of stuff.

But to my original point.

When you want to create a class with a method you do just that. No need to use 
any mock infra.

-- 
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: Federico Simoncelli <[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: No
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to