On 04/16/2014 08:11 AM, Jay Pipes wrote:
On Wed, 2014-04-16 at 14:55 +0800, Chen CH Ji wrote:
Hi
There are 3 types of unit test existing now (stub, mox
and mock)
Several code reviewers suggest to use mock instead of
using the other 2 and I am following it, but I want to know where can
I find the suggestion and guide line?
Hi Kevin!
So, there are only two unit testing methods -- mock and mox. stubs are
part of the mox-style way of doing things.
My general rules of thumb when doing reviews in Nova are these:
1) For new unit tests, use mock
2) Don't mix mock and mox in a single test method
3) When modifying existing unit tests, unless rewriting the test method
almost entirely, stick with whatever is used already (mock or mox)
Best,
-jay
These points are also documented here:
https://wiki.openstack.org/wiki/ReviewChecklist (see point 4 under the
Common Review Checklist)
-Ben
_______________________________________________
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev