diff options
| author | Tang Chen <chen.tang@easystack.cn> | 2016-02-23 00:14:56 +0800 |
|---|---|---|
| committer | Tang Chen <chen.tang@easystack.cn> | 2016-02-23 00:14:56 +0800 |
| commit | c57fc41c33df58237f6b3ec8a5b2a0ff9573da2e (patch) | |
| tree | 24f62d0e5cf613dedc70eddd40a2af0aeeff3310 /openstackclient | |
| parent | ba08683d90277e3cc6f943a2a994ccf08589cb1a (diff) | |
| download | python-openstackclient-c57fc41c33df58237f6b3ec8a5b2a0ff9573da2e.tar.gz | |
Initialize _keys in __init__() in FakeFlavorResource
_keys is defined as a class attribute in FakeFlavorResource. So when
we call set_keys() to update it, it changes. And this change may bring
trouble to the other tests afterward.
So define and initialize it in __init__() as an object attribute.
Change-Id: Ib18c03877b67e1b7c2e107f598076b928a58e4fb
Closes-bug: #1548378
Diffstat (limited to 'openstackclient')
| -rw-r--r-- | openstackclient/tests/compute/v2/fakes.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/openstackclient/tests/compute/v2/fakes.py b/openstackclient/tests/compute/v2/fakes.py index 96d85b0c..c0db9b24 100644 --- a/openstackclient/tests/compute/v2/fakes.py +++ b/openstackclient/tests/compute/v2/fakes.py @@ -372,8 +372,11 @@ class FakeFlavorResource(fakes.FakeResource): Need to fake them, otherwise the functions to be tested won't run properly. """ - # Fake properties. - _keys = {'property': 'value'} + def __init__(self, manager=None, info={}, loaded=False, methods={}): + super(FakeFlavorResource, self).__init__(manager, info, + loaded, methods) + # Fake properties. + self._keys = {'property': 'value'} def set_keys(self, args): self._keys.update(args) |
