summaryrefslogtreecommitdiff
path: root/openstackclient/tests/network/v2/fakes.py
diff options
context:
space:
mode:
authorTang Chen <chen.tang@easystack.cn>2016-03-03 20:50:17 +0800
committerTang Chen <chen.tang@easystack.cn>2016-03-03 20:50:17 +0800
commit50443127c56e4de94bdd141ce22900d63736fbea (patch)
treee86a272377eee09f04f50edb21346d3a29652853 /openstackclient/tests/network/v2/fakes.py
parent4ab66631d016cf1e01d7825c8eae678bf9f778ca (diff)
downloadpython-openstackclient-50443127c56e4de94bdd141ce22900d63736fbea.tar.gz
Fix incorrect unit test for router
Command "router show" will display router's "tenant_id" as "project_id". But in the unit test, it checks "tenant_id", which is incorrect. This patch fix this problem, and add a _get_columns() helper function to simplify the code. Change-Id: I0087ef7dfd0130b6c47222495848c4f2b9804b1b
Diffstat (limited to 'openstackclient/tests/network/v2/fakes.py')
-rw-r--r--openstackclient/tests/network/v2/fakes.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/openstackclient/tests/network/v2/fakes.py b/openstackclient/tests/network/v2/fakes.py
index cfd05729..9e6bf97f 100644
--- a/openstackclient/tests/network/v2/fakes.py
+++ b/openstackclient/tests/network/v2/fakes.py
@@ -370,6 +370,10 @@ class FakeRouter(object):
router = fakes.FakeResource(info=copy.deepcopy(router_attrs),
methods=copy.deepcopy(router_methods),
loaded=True)
+
+ # Set attributes with special mapping in OpenStack SDK.
+ router.project_id = router_attrs['tenant_id']
+
return router
@staticmethod