Nir Soffer has posted comments on this change. Change subject: tests: Add simple mocking library ......................................................................
Patch Set 1: > The article puts "Coupling Tests to Implementation" as a plus which I > personally disagree with and was the main point of my arguments. I don't see how mocks add couple tests to the implementation. > The article assumes you are using languages like Java\C# where creating a > method or a class is hard and costly. It usually requires a new file to put > the mock function\class in and has tons of boilerplate. It does not assume certain languages. I don't know about C# but in Java it is very easy to create new classes without adding new files, even inside other classes or functions. > As I addressed in my comments this is a problem that does not plague python > as it's syntax in light and flexible. Creating classes and methods is > painless and can happen mid functions so using the mock objects DSL does not > add brevity and celerity as it supposed to in Java\C# but instead does the > complete opposite. Mocks libraries are used in other languages with light and flexible syntax like Ruby. > The point of using mock objects is to prevent use of the real thing. Since > python is duck typed there is no reason to have a mock framework. No, the point of mock objects is to have a programmable object that can serve as the real thing and avoid the work required for creating multiple stubs. > I was never against creating mock objects. I was against verifying input and > using a "framework" since in python it is useless. Mocking library is not useless, even in Python. It is true that in Python you can avoid mocks in lot of cases by using simple fake objects or monkey patching real objects, but sometimes mocks are simply the best tool. -- 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
