Files
python-openstackclient/openstackclient
Tang Chen 20bf1ef675 Enable FakeResource to fake methods.
Use MagicMock to fake a method in FakeResource. A new function:

    add_method(name, return_value)

is added to FakeResource. The caller specifies method @name and @return_value,
the function will add an attribute with @name, which is a callable MagicMock
object whose return value is @return_value.

When user access the attribute with a (), @return_value will be returned by
MagicMock, which looks like a function call.

Change-Id: I12eb876cbebab064773df7b5dd612de69bbf3f01
Implements: blueprint osc-unit-test-framework-improvement
2015-11-19 18:23:08 +08:00
..
2015-11-12 00:03:14 +00:00
2015-10-10 11:48:07 -04:00