From 13bc3793e0f0378db0151acb171dbe5f2d9c08dd Mon Sep 17 00:00:00 2001 From: Huanxuan Ao Date: Mon, 25 Jul 2016 17:37:41 +0800 Subject: Implement network rbac create and delete commands Add "network rbac create" and "network rbac delete" commands and also add unit tests, functional tests, docs and release note for them. Change-Id: I5fd58342f2deaa9bae7717412a942a21bbd7d045 Partially-Implements: blueprint neutron-client-rbac --- openstackclient/tests/network/v2/fakes.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'openstackclient/tests/network/v2/fakes.py') diff --git a/openstackclient/tests/network/v2/fakes.py b/openstackclient/tests/network/v2/fakes.py index 05752094..9182fe55 100644 --- a/openstackclient/tests/network/v2/fakes.py +++ b/openstackclient/tests/network/v2/fakes.py @@ -541,6 +541,25 @@ class FakeNetworkRBAC(object): return rbac_policies + @staticmethod + def get_network_rbacs(rbac_policies=None, count=2): + """Get an iterable MagicMock object with a list of faked rbac policies. + + If rbac policies list is provided, then initialize the Mock object + with the list. Otherwise create one. + + :param List rbac_policies: + A list of FakeResource objects faking rbac policies + :param int count: + The number of rbac policies to fake + :return: + An iterable Mock object with side_effect set to a list of faked + rbac policies + """ + if rbac_policies is None: + rbac_policies = FakeNetworkRBAC.create_network_rbacs(count) + return mock.MagicMock(side_effect=rbac_policies) + class FakeRouter(object): """Fake one or more routers.""" -- cgit v1.2.1