def test_missing_key(self):
     assert role_utils._rule_set([{
         'verbs': ['list', 'get'],
         'resources': ['entities', 'checks'],
     }]) == {(frozenset(['get',
                         'list']), frozenset(['checks',
                                              'entities']), frozenset())}
Beispiel #2
0
 def test_rules_multiple(self):
     assert role_utils._rule_set([{
         'verbs': ['list', 'get'],
         'resources': ['entities', 'checks'],
         'resource_names': None
     }, {
         'verbs': ['list', 'delete'],
         'resources': ['entities', 'checks'],
         'resource_names': None
     }]) == set((
         (frozenset(['delete', 'list']), frozenset(['checks', 'entities']), frozenset()),
         (frozenset(['get', 'list']), frozenset(['checks', 'entities']), frozenset())
     ))
 def test_all_keys_none(self):
     assert role_utils._rule_set([{}]) == {(frozenset(), frozenset(),
                                            frozenset())}