Add filters "policy_type" and "policy_name" for policy binding list
Add "policy_type" and "policy_name" to query map. Add QueryParameters related unit test case. Depends-On: I452173dff86f75d82bfa967ea333ad42be95d488 Closed-Bug: 1634407 Change-Id: I8363dadbb6afe810ceb161c59027eefca966f011
This commit is contained in:
parent
c64678868e
commit
73f70f1a92
@ -24,7 +24,8 @@ class ClusterPolicy(resource.Resource):
|
||||
allow_list = True
|
||||
allow_get = True
|
||||
|
||||
_query_mapping = resource.QueryParameters(is_enabled='enabled')
|
||||
_query_mapping = resource.QueryParameters(
|
||||
'policy_name', 'policy_type', is_enabled='enabled')
|
||||
|
||||
# Properties
|
||||
#: ID of the policy object.
|
||||
|
@ -41,6 +41,13 @@ class TestClusterPolicy(testtools.TestCase):
|
||||
self.assertTrue(sot.allow_get)
|
||||
self.assertTrue(sot.allow_list)
|
||||
|
||||
self.assertDictEqual({"policy_name": "policy_name",
|
||||
"policy_type": "policy_type",
|
||||
"is_enabled": "enabled",
|
||||
"limit": "limit",
|
||||
"marker": "marker"},
|
||||
sot._query_mapping._mapping)
|
||||
|
||||
def test_instantiate(self):
|
||||
sot = cluster_policy.ClusterPolicy(**FAKE)
|
||||
self.assertEqual(FAKE['policy_id'], sot.id)
|
||||
|
Loading…
x
Reference in New Issue
Block a user