aboutsummaryrefslogtreecommitdiffstats
path: root/python_moonclient/tests/unit_python/conf/conf_action_assignments.py
blob: 43c4db59af287b0dbb535c27cc12ed26bade2293 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
from .conf_all import *

POST_ACTION_ASSIGNMENT = {
    "action_assignments":{
        "1":{
            "policy_id": "1",
            "action_id": "2",
            "category_id": "1",
            "assignments": ["1"]
        }
    }
}

POST_OTHER_ACTION_ASSIGNMENT = {
    "action_assignments":{
        "2":{
            "policy_id": "1",
            "action_id": "2",
            "category_id": "1",
            "assignments": ["2"]
        }
    }
}

DELETE_ACTION_ASSIGNMENT = {
    "action_assignments":{

    }
}


def conf_action_assignments(m):
    m.register_uri(
        'GET', 'http://manager:30001/policies/2/action_assignments/2/1/1',
        [{'headers': {'X-Subject-Token': "111111111"}, 'json': POST_ACTION_ASSIGNMENT},
         {'headers': {'X-Subject-Token': "111111111"}, 'json': DELETE_ACTION_ASSIGNMENT}]
    )
    m.register_uri(
        'GET', 'http://manager:30001/policies/2/action_assignments/2/1/2',
        headers={'X-Subject-Token': "111111111"},
        json=POST_OTHER_ACTION_ASSIGNMENT
    )
    m.register_uri(
        'POST', 'http://manager:30001/policies/2/action_assignments',
        headers={'X-Subject-Token': "111111111"},
        json=POST_ACTION_ASSIGNMENT
    )
    m.register_uri(
        'DELETE', 'http://manager:30001/policies/2/action_assignments/2/1/1',
        json=RESULT_OK
    )