Debian Codegraph @

keystoneclient/tests/unit/v3/test_access_rules.py

raw symbols SCIP
1 # Licensed under the Apache License, Version 2.0 (the "License");
2 # you may not use this file except in compliance with the License.
3 # You may obtain a copy of the License at
4 #
5 # http://www.apache.org/licenses/LICENSE-2.0
6 #
7 # Unless required by applicable law or agreed to in writing, software
8 # distributed under the License is distributed on an "AS IS" BASIS,
9 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
10 # implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
13
14 import uuid
15
16 from keystoneclient import exceptions
17 from keystoneclient.tests.unit.v3 import utils
18 from keystoneclient.v3 import access_rules
19
20
21 class AccessRuleTests(utils.ClientTestCase, utils.CrudTests):
22 def setUp(self):
23 super(AccessRuleTests, self).setUp()
24 self.key = 'access_rule'
25 self.collection_key = 'access_rules'
26 self.model = access_rules.AccessRule
27 self.manager = self.client.access_rules
28 self.path_prefix = 'users/%s' % self.TEST_USER_ID
29
30 def new_ref(self, **kwargs):
31 kwargs = super(AccessRuleTests, self).new_ref(**kwargs)
32 kwargs.setdefault('path', uuid.uuid4().hex)
33 kwargs.setdefault('method', uuid.uuid4().hex)
34 kwargs.setdefault('service', uuid.uuid4().hex)
35 return kwargs
36
37 def test_update(self):
38 self.assertRaises(exceptions.MethodNotImplemented, self.manager.update)
39
40 def test_create(self):
41 self.assertRaises(exceptions.MethodNotImplemented, self.manager.create)