diff options
Diffstat (limited to 'python_moonclient/tests/unit_python/conf')
19 files changed, 0 insertions, 1183 deletions
diff --git a/python_moonclient/tests/unit_python/conf/conf_action_assignments.py b/python_moonclient/tests/unit_python/conf/conf_action_assignments.py deleted file mode 100644 index 43c4db59..00000000 --- a/python_moonclient/tests/unit_python/conf/conf_action_assignments.py +++ /dev/null @@ -1,51 +0,0 @@ -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 - )
\ No newline at end of file diff --git a/python_moonclient/tests/unit_python/conf/conf_action_categories.py b/python_moonclient/tests/unit_python/conf/conf_action_categories.py deleted file mode 100644 index 909befb2..00000000 --- a/python_moonclient/tests/unit_python/conf/conf_action_categories.py +++ /dev/null @@ -1,32 +0,0 @@ - - -ACTION_CATEGORIES = { - "action_categories": { - "1": { - "name": "action_cat_1", - "description": "description of the category" - } - } -} - -POST_ACTION_CATEGORIES = { - "action_categories": { - "1": { - "name": "action_cat_1", - "description": "description of the category" - } - } -} - - -def conf_action_categories(m): - m.register_uri( - 'GET', 'http://manager:30001/action_categories', - headers={'X-Subject-Token': "111111111"}, - json=ACTION_CATEGORIES - ) - m.register_uri( - 'POST', 'http://manager:30001/action_categories', - headers={'X-Subject-Token': "111111111"}, - json=POST_ACTION_CATEGORIES - )
\ No newline at end of file diff --git a/python_moonclient/tests/unit_python/conf/conf_action_data.py b/python_moonclient/tests/unit_python/conf/conf_action_data.py deleted file mode 100644 index fb6f501c..00000000 --- a/python_moonclient/tests/unit_python/conf/conf_action_data.py +++ /dev/null @@ -1,66 +0,0 @@ -from .conf_all import * - -ACTION_DATA = { - "action_data":[{ - "policy_id": "1", - "category_id": "1", - "data": { - "1": { - "name": "name of the data", - "description": "description of the data" - } - } - }] -} - -POST_ACTION_DATA = { - "action_data":{ - "policy_id": "1", - "category_id": "1", - "data": { - "1": { - "name": "name of the data", - "description": "description of the data" - } - } - } -} - -POST_OTHER_ACTION_DATA = { - "action_data":{ - "policy_id": "1", - "category_id": "1", - "data": { - "2": { - "name": "name of the data", - "description": "description of the data" - } - } - } -} - -DELETE_ACTION_DATA= { - "action_data":[{ - "policy_id": "1", - "category_id": "1", - "data":{} - }] -} - - -def conf_action_data(m): - m.register_uri( - 'POST', 'http://manager:30001/policies/2/action_data/1', - [{'headers': {'X-Subject-Token': "111111111"}, 'json': POST_ACTION_DATA}, - {'headers': {'X-Subject-Token': "111111111"}, 'json': POST_OTHER_ACTION_DATA}] - ) - m.register_uri( - 'GET', 'http://manager:30001/policies/2/action_data/1', - [{'headers': {'X-Subject-Token': "111111111"}, 'json': ACTION_DATA}, - {'headers': {'X-Subject-Token': "111111111"}, 'json': DELETE_ACTION_DATA}] - ) - m.register_uri( - 'DELETE', 'http://manager:30001/policies/2/action_data/1/1', - headers={'X-Subject-Token': "111111111"}, - json=RESULT_OK - )
\ No newline at end of file diff --git a/python_moonclient/tests/unit_python/conf/conf_actions.py b/python_moonclient/tests/unit_python/conf/conf_actions.py deleted file mode 100644 index 4e6784dd..00000000 --- a/python_moonclient/tests/unit_python/conf/conf_actions.py +++ /dev/null @@ -1,111 +0,0 @@ -from .conf_all import * - -ACTIONS = { - "actions":{ - "1": { - "name": "name of the action", - "keystone_id": "1", - "description": "a description", - "policy_list": ["1"] - } - } -} - -ACTIONS_AFTER_POST = { - "actions":{ - "1": { - "name": "name of the action", - "keystone_id": "1", - "description": "a description", - "policy_list": ["1"] - }, - "2": { - "name": "test_action", - "keystone_id": "1", - "description": "a description", - "policy_list": [] - } - } -} - -ACTIONS_AFTER_PATCH = { - "actions":{ - "1": { - "name": "name of the action", - "keystone_id": "1", - "description": "a description", - "policy_list": ["1"] - }, - "2": { - "name": "test_action", - "keystone_id": "1", - "description": "a description", - "policy_list": ["2"] - } - } -} - - -POST_ACTIONS = { - "actions":{ - "2": { - "name": "test_action", - "keystone_id": "1", - "description": "a description", - "policy_list": [] - } - } -} - -PATCH_ACTIONS = { - "actions":{ - "2": { - "name": "test_action", - "keystone_id": "1", - "description": "a description", - "policy_list": ["2"] - } - } -} - -def conf_actions(m): - m.register_uri( - 'GET', 'http://manager:30001/actions', - headers={'X-Subject-Token': "111111111"}, - json=ACTIONS - ) - m.register_uri( - 'POST', 'http://manager:30001/actions', - headers={'X-Subject-Token': "111111111"}, - json=POST_ACTIONS - ) - m.register_uri( - 'DELETE', 'http://manager:30001/actions/2', - headers={'X-Subject-Token': "111111111"}, - json=RESULT_OK - ) - m.register_uri( - 'PATCH', 'http://manager:30001/policies/2/actions/2', - headers={'X-Subject-Token': "111111111"}, - json=PATCH_ACTIONS - ) - m.register_uri( - 'GET', 'http://manager:30001/policies/2/actions', - headers={'X-Subject-Token': "111111111"}, - json=ACTIONS_AFTER_PATCH - ) - m.register_uri( - 'POST', 'http://manager:30001/policies/2/actions', - headers={'X-Subject-Token': "111111111"}, - json=POST_ACTIONS - ) - m.register_uri( - 'GET', 'http://manager:30001/policies/2/actions/2', - headers={'X-Subject-Token': "111111111"}, - json=PATCH_ACTIONS - ) - m.register_uri( - 'DELETE', 'http://manager:30001/policies/2/actions/2', - headers={'X-Subject-Token': "111111111"}, - json=RESULT_OK - )
\ No newline at end of file diff --git a/python_moonclient/tests/unit_python/conf/conf_all.py b/python_moonclient/tests/unit_python/conf/conf_all.py deleted file mode 100644 index b87d4fe7..00000000 --- a/python_moonclient/tests/unit_python/conf/conf_all.py +++ /dev/null @@ -1 +0,0 @@ -RESULT_OK = {"result": "OK"} diff --git a/python_moonclient/tests/unit_python/conf/conf_meta_rules.py b/python_moonclient/tests/unit_python/conf/conf_meta_rules.py deleted file mode 100644 index 67c14ddf..00000000 --- a/python_moonclient/tests/unit_python/conf/conf_meta_rules.py +++ /dev/null @@ -1,44 +0,0 @@ -from .conf_all import * - - -META_RULES = { - "meta_rules": { - "1": { - "name": "test_meta_rule", - "algorithm": "name of the meta rule algorithm", - "subject_categories": ["1"], - "object_categories": ["1"], - "action_categories": ["1"] - } - } -} - -POST_META_RULES = { - "meta_rules": { - "1": { - "name": "test_meta_rule", - "algorithm": "name of the meta rule algorithm", - "subject_categories": ["1"], - "object_categories": ["1"], - "action_categories": ["1"] - } - } -} - - -def conf_meta_rules(m): - m.register_uri( - 'GET', 'http://manager:30001/meta_rules', - headers={'X-Subject-Token': "111111111"}, - json=META_RULES - ) - m.register_uri( - 'POST', 'http://manager:30001/meta_rules', - headers={'X-Subject-Token': "111111111"}, - json=POST_META_RULES - ) - m.register_uri( - 'DELETE', 'http://manager:30001/meta_rules/1', - headers={'X-Subject-Token': "111111111"}, - json=RESULT_OK - ) diff --git a/python_moonclient/tests/unit_python/conf/conf_models.py b/python_moonclient/tests/unit_python/conf/conf_models.py deleted file mode 100644 index 930af88f..00000000 --- a/python_moonclient/tests/unit_python/conf/conf_models.py +++ /dev/null @@ -1,94 +0,0 @@ -from .conf_all import * - - -MODELS = { - "models": { - "1": { - "name": "model 1", - "description": "description model 1", - "meta_rules": [{ - "meta_rule_id": "1" - }, { - "meta_rule_id": "2" - }] - }, - "2": { - "name": "model 2", - "description": "description model 2", - "meta_rules": ["2"] - }, - "3": { - "name": "test_model", - "description": "description model 3", - "meta_rules": ["2"] - } - } -} - -POST_MODEL = { - "models": { - "3": { - "name": "test_model", - "description": "description model 3", - "meta_rules": ["2"] - } - } -} - -PATCH_MODEL = { - "models": { - "3": { - "name": "test_model", - "description": "description model 3", - "meta_rules": ["2", "1"] - } - } -} - - -MODELS_AFTER_POST = { -"models": { - "1": { - "name": "model 1", - "description": "description model 1", - "meta_rules": [{ - "meta_rule_id": "1" - }, { - "meta_rule_id": "2" - }] - }, - "2": { - "name": "model 2", - "description": "description model 2", - "meta_rules": ["2"] - }, - "3": { - "name": "test_model", - "description": "description model 3", - "meta_rules": ["1", "2"] - } - } -} - - -def conf_models(m): - m.register_uri( - 'GET', 'http://manager:30001/models', - [{'json': MODELS, 'headers': {'X-Subject-Token': "111111111"}}, - {'json': MODELS_AFTER_POST, 'headers': {'X-Subject-Token': "111111111"}}] - ) - m.register_uri( - 'POST', 'http://manager:30001/models', - headers={'X-Subject-Token': "111111111"}, - json=POST_MODEL - ) - m.register_uri( - 'PATCH', 'http://manager:30001/models/3', - headers={'X-Subject-Token': "111111111"}, - json=PATCH_MODEL - ) - m.register_uri( - 'DELETE', 'http://manager:30001/models/3', - headers={'X-Subject-Token': "111111111"}, - json=RESULT_OK - )
\ No newline at end of file diff --git a/python_moonclient/tests/unit_python/conf/conf_object_assignments.py b/python_moonclient/tests/unit_python/conf/conf_object_assignments.py deleted file mode 100644 index 9e88e03e..00000000 --- a/python_moonclient/tests/unit_python/conf/conf_object_assignments.py +++ /dev/null @@ -1,51 +0,0 @@ -from .conf_all import * - -POST_OBJECT_ASSIGNMENT = { - "object_assignments":{ - "1":{ - "policy_id": "1", - "object_id": "2", - "category_id": "1", - "assignments": ["1"] - } - } -} - -POST_OTHER_OBJECT_ASSIGNMENT = { - "object_assignments":{ - "2":{ - "policy_id": "1", - "object_id": "2", - "category_id": "1", - "assignments": ["2"] - } - } -} - -DELETE_OBJECT_ASSIGNMENT = { - "object_assignments":{ - - } -} - - -def conf_object_assignments(m): - m.register_uri( - 'GET', 'http://manager:30001/policies/2/object_assignments/2/1/1', - [{'headers': {'X-Subject-Token': "111111111"}, 'json': POST_OBJECT_ASSIGNMENT}, - {'headers': {'X-Subject-Token': "111111111"}, 'json': DELETE_OBJECT_ASSIGNMENT}] - ) - m.register_uri( - 'GET', 'http://manager:30001/policies/2/object_assignments/2/1/2', - headers={'X-Subject-Token': "111111111"}, - json=POST_OTHER_OBJECT_ASSIGNMENT - ) - m.register_uri( - 'POST', 'http://manager:30001/policies/2/object_assignments', - headers={'X-Subject-Token': "111111111"}, - json=POST_OBJECT_ASSIGNMENT - ) - m.register_uri( - 'DELETE', 'http://manager:30001/policies/2/object_assignments/2/1/1', - json=RESULT_OK - )
\ No newline at end of file diff --git a/python_moonclient/tests/unit_python/conf/conf_object_categories.py b/python_moonclient/tests/unit_python/conf/conf_object_categories.py deleted file mode 100644 index a942f9c6..00000000 --- a/python_moonclient/tests/unit_python/conf/conf_object_categories.py +++ /dev/null @@ -1,31 +0,0 @@ - -OBJECT_CATEGORIES = { - "object_categories": { - "1": { - "name": "object_cat_1", - "description": "description of the category" - } - } -} - -POST_OBJECT_CATEGORIES = { - "object_categories": { - "1": { - "name": "object_cat_1", - "description": "description of the category" - } - } -} - - -def conf_object_categories(m): - m.register_uri( - 'GET', 'http://manager:30001/object_categories', - headers={'X-Subject-Token': "111111111"}, - json=OBJECT_CATEGORIES - ) - m.register_uri( - 'POST', 'http://manager:30001/object_categories', - headers={'X-Subject-Token': "111111111"}, - json=POST_OBJECT_CATEGORIES - ) diff --git a/python_moonclient/tests/unit_python/conf/conf_object_data.py b/python_moonclient/tests/unit_python/conf/conf_object_data.py deleted file mode 100644 index 8fa81d69..00000000 --- a/python_moonclient/tests/unit_python/conf/conf_object_data.py +++ /dev/null @@ -1,67 +0,0 @@ - -from .conf_all import * - -OBJECT_DATA = { - "object_data":[{ - "policy_id": "1", - "category_id": "1", - "data": { - "1": { - "name": "name of the data", - "description": "description of the data" - } - } - }] -} - -POST_OBJECT_DATA = { - "object_data":{ - "policy_id": "1", - "category_id": "1", - "data": { - "1": { - "name": "name of the data", - "description": "description of the data" - } - } - } -} - -POST_OTHER_OBJECT_DATA = { - "object_data":{ - "policy_id": "1", - "category_id": "1", - "data": { - "2": { - "name": "name of the data", - "description": "description of the data" - } - } - } -} - -DELETE_OBJECT_DATA= { - "object_data":[{ - "policy_id": "1", - "category_id": "1", - "data":{} - }] -} - - -def conf_object_data(m): - m.register_uri( - 'POST', 'http://manager:30001/policies/2/object_data/1', - [{'headers': {'X-Subject-Token': "111111111"}, 'json': POST_OBJECT_DATA}, - {'headers': {'X-Subject-Token': "111111111"}, 'json': POST_OTHER_OBJECT_DATA}] - ) - m.register_uri( - 'GET', 'http://manager:30001/policies/2/object_data/1', - [{'headers': {'X-Subject-Token': "111111111"}, 'json': OBJECT_DATA}, - {'headers': {'X-Subject-Token': "111111111"}, 'json': DELETE_OBJECT_DATA}] - ) - m.register_uri( - 'DELETE', 'http://manager:30001/policies/2/object_data/1/1', - headers={'X-Subject-Token': "111111111"}, - json=RESULT_OK - ) diff --git a/python_moonclient/tests/unit_python/conf/conf_objects.py b/python_moonclient/tests/unit_python/conf/conf_objects.py deleted file mode 100644 index cf3e7aa4..00000000 --- a/python_moonclient/tests/unit_python/conf/conf_objects.py +++ /dev/null @@ -1,112 +0,0 @@ -from .conf_all import * - -OBJECTS = { - "objects":{ - "1": { - "name": "name of the object", - "keystone_id": "1", - "description": "a description", - "policy_list": ["1"] - } - } -} - -OBJECTS_AFTER_POST = { - "objects":{ - "1": { - "name": "name of the object", - "keystone_id": "1", - "description": "a description", - "policy_list": ["1"] - }, - "2": { - "name": "test_object", - "keystone_id": "1", - "description": "a description", - "policy_list": [] - } - } -} - -OBJECTS_AFTER_PATCH = { - "objects":{ - "1": { - "name": "name of the object", - "keystone_id": "1", - "description": "a description", - "policy_list": ["1"] - }, - "2": { - "name": "test_object", - "keystone_id": "1", - "description": "a description", - "policy_list": ["2"] - } - } -} - - -POST_OBJECTS = { - "objects":{ - "2": { - "name": "test_object", - "keystone_id": "1", - "description": "a description", - "policy_list": [] - } - } -} - -PATCH_OBJECTS = { - "objects":{ - "2": { - "name": "test_object", - "keystone_id": "1", - "description": "a description", - "policy_list": ["2"] - } - } -} - -def conf_objects(m): - m.register_uri( - 'GET', 'http://manager:30001/objects', - [{'json': OBJECTS, 'headers': {'X-Subject-Token': "111111111"}}, - {'json': OBJECTS_AFTER_POST, 'headers': {'X-Subject-Token': "111111111"}}, - {'json': OBJECTS, 'headers': {'X-Subject-Token': "111111111"}}] - ) - m.register_uri( - 'POST', 'http://manager:30001/objects', - headers={'X-Subject-Token': "111111111"}, - json=POST_OBJECTS - ) - m.register_uri( - 'DELETE', 'http://manager:30001/objects/2', - headers={'X-Subject-Token': "111111111"}, - json=RESULT_OK - ) - m.register_uri( - 'PATCH', 'http://manager:30001/policies/2/objects/2', - headers={'X-Subject-Token': "111111111"}, - json=PATCH_OBJECTS - ) - m.register_uri( - 'GET', 'http://manager:30001/policies/2/objects', - headers={'X-Subject-Token': "111111111"}, - json=OBJECTS_AFTER_PATCH - ) - m.register_uri( - 'POST', 'http://manager:30001/policies/2/objects', - headers={'X-Subject-Token': "111111111"}, - json=POST_OBJECTS - ) - m.register_uri( - 'GET', 'http://manager:30001/policies/2/objects/2', - headers={'X-Subject-Token': "111111111"}, - json=PATCH_OBJECTS - ) - m.register_uri( - 'DELETE', 'http://manager:30001/policies/2/objects/2', - headers={'X-Subject-Token': "111111111"}, - json=RESULT_OK - ) diff --git a/python_moonclient/tests/unit_python/conf/conf_pdps.py b/python_moonclient/tests/unit_python/conf/conf_pdps.py deleted file mode 100644 index 1090fccb..00000000 --- a/python_moonclient/tests/unit_python/conf/conf_pdps.py +++ /dev/null @@ -1,95 +0,0 @@ -from .conf_all import * - -PDPS = { - "pdps": { - "1": { - "name": "...", - "security_pipeline": [], - "keystone_project_id": "", - "description": "...", - } - } - } - - -POST_PDP = { - "pdps": { - "2": { - "name": "test_pdp", - "security_pipeline": [], - "keystone_project_id": "", - "description": "..." - } - } - } - -PATCH_PDP = { - "pdps": { - "2": { - "name": "test_pdp", - "security_pipeline": [], - "keystone_project_id": "0c4e939acacf4376bdcd1129f1a054ad", - "description": "..." - } - } - } - -PDPS_AFTER_POST = { - "pdps": { - "1": { - "name": "...", - "security_pipeline": [], - "keystone_project_id": "", - "description": "...", - }, - - "2": { - "name": "test_pdp", - "security_pipeline": [], - "keystone_project_id": "", - "description": "...", - } - } - } - -PDPS_AFTER_PATCH = { - "pdps": { - "1": { - "name": "...", - "security_pipeline": [], - "keystone_project_id": "", - "description": "...", - }, - - "2": { - "name": "test_pdp", - "security_pipeline": [], - "keystone_project_id": "0c4e939acacf4376bdcd1129f1a054ad", - "description": "...", - } - } - } - -def conf_pdps(m): - m.register_uri( - 'GET', 'http://manager:30001/pdp', - [{'json': PDPS, 'headers': {'X-Subject-Token': "111111111"}}, - {'json': PDPS_AFTER_POST, 'headers': {'X-Subject-Token': "111111111"}}, - {'json': PDPS_AFTER_PATCH, 'headers': {'X-Subject-Token': "111111111"}}, - {'json': PDPS, 'headers': {'X-Subject-Token': "111111111"}}] - ) - m.register_uri( - 'POST', 'http://manager:30001/pdp', - headers={'X-Subject-Token': "111111111"}, - json=POST_PDP - ) - m.register_uri( - 'PATCH', 'http://manager:30001/pdp/2', - headers={'X-Subject-Token': "111111111"}, - json=PATCH_PDP - ) - m.register_uri( - 'DELETE', 'http://manager:30001/pdp/2', - headers={'X-Subject-Token': "111111111"}, - json=RESULT_OK - )
\ No newline at end of file diff --git a/python_moonclient/tests/unit_python/conf/conf_policies.py b/python_moonclient/tests/unit_python/conf/conf_policies.py deleted file mode 100644 index bf6883bc..00000000 --- a/python_moonclient/tests/unit_python/conf/conf_policies.py +++ /dev/null @@ -1,78 +0,0 @@ -from .conf_all import * - -POLICIES = { - "policies":{ - "1": { - "name": "test_policy", - "model_id": "1", - "genre": "authz", - "description": "Description of the policy", - } - } -} - -POLICIES_AFTER_POST= { - "policies":{ - "1": { - "name": "test_policy", - "model_id": "1", - "genre": "authz", - "description": "Description of the policy", - }, - "2": { - "name": "test_policy", - "model_id": "", - "genre": "", - "description": "Description of the policy", - } - } -} - - -POST_POLICIES ={ - "policies":{ - "2": { - "name": "test_policy", - "model_id": "", - "genre": "", - "description": "Description of the policy", - } - } -} - - -PATCH_POLICIES ={ - "policies":{ - "2": { - "name": "test_policy", - "model_id": "3", - "genre": "authz", - "description": "Description of the policy", - } - } -} - - -def conf_policies(m): - m.register_uri( - 'GET', 'http://manager:30001/policies', - [{'json': POLICIES, 'headers': {'X-Subject-Token': "111111111"}}, - {'json': POLICIES_AFTER_POST, 'headers': {'X-Subject-Token': "111111111"}}, - {'json': POLICIES, 'headers': {'X-Subject-Token': "111111111"}}] - - ) - m.register_uri( - 'POST', 'http://manager:30001/policies', - headers={'X-Subject-Token': "111111111"}, - json=POST_POLICIES - ) - m.register_uri( - 'PATCH', 'http://manager:30001/policies/2', - headers={'X-Subject-Token': "111111111"}, - json=PATCH_POLICIES - ) - m.register_uri( - 'DELETE', 'http://manager:30001/policies/2', - headers={'X-Subject-Token': "111111111"}, - json=RESULT_OK - )
\ No newline at end of file diff --git a/python_moonclient/tests/unit_python/conf/conf_projects.py b/python_moonclient/tests/unit_python/conf/conf_projects.py deleted file mode 100644 index 63be05e0..00000000 --- a/python_moonclient/tests/unit_python/conf/conf_projects.py +++ /dev/null @@ -1,44 +0,0 @@ - - -PROJECTS = { - "projects": [ - { - "is_domain": False, - "description": None, - "domain_id": "admin", - "enabled": True, - "id": "0c4e939acacf4376bdcd1129f1a054ad", - "links": { - "self": "http://example.com/identity/v3/projects/0c4e939acacf4376bdcd1129f1a054ad" - }, - "name": "admin", - "parent_id": None, - "tags": [] - }, - { - "is_domain": False, - "description": None, - "domain_id": "default", - "enabled": True, - "id": "0cbd49cbf76d405d9c86562e1d579bd3", - "links": { - "self": "http://example.com/identity/v3/projects/0cbd49cbf76d405d9c86562e1d579bd3" - }, - "name": "demo", - "parent_id": None, - "tags": [] - } - ] -} - - -def conf_projects(m): - m.register_uri( - 'GET', 'http://keystone:5000/v3/projects', - headers={'X-Subject-Token': "111111111"}, - json=PROJECTS - ) - m.register_uri( - 'POST', 'http://keystone:5000/v3/auth/tokens', - headers={'X-Subject-Token': "111111111"} - ) diff --git a/python_moonclient/tests/unit_python/conf/conf_rules.py b/python_moonclient/tests/unit_python/conf/conf_rules.py deleted file mode 100644 index 30b8c682..00000000 --- a/python_moonclient/tests/unit_python/conf/conf_rules.py +++ /dev/null @@ -1,46 +0,0 @@ -from .conf_all import * - -RULES = { - "rules":{ - "policy_id": "2", - "rules": [{ - "meta_rule_id": "1", - "id": "1", - "rule": ["1", "1", "1"] - }] - } -} - -POST_RULES = { - "rules":{ - "1":{ - "policy_id": "2", - "meta_rule_id": "1", - "rule": ["1", "1", "1"] - } - } -} - -DELETE_RULES = { - "rules":{ - "policy_id": "2", - "rules": [] - } -} - - -def conf_rule_assignments(m): - m.register_uri( - 'GET', 'http://manager:30001/policies/2/rules', - [{'headers': {'X-Subject-Token': "111111111"}, 'json': RULES}, - {'headers': {'X-Subject-Token': "111111111"}, 'json': DELETE_RULES}] - ) - m.register_uri( - 'POST', 'http://manager:30001/policies/2/rules', - [{'headers': {'X-Subject-Token': "111111111"}, 'json': POST_RULES}] - ) - m.register_uri( - 'DELETE', 'http://manager:30001/policies/2/rules/1', - headers={'X-Subject-Token': "111111111"}, - json=RESULT_OK - )
\ No newline at end of file diff --git a/python_moonclient/tests/unit_python/conf/conf_subject_assignments.py b/python_moonclient/tests/unit_python/conf/conf_subject_assignments.py deleted file mode 100644 index 92b689c0..00000000 --- a/python_moonclient/tests/unit_python/conf/conf_subject_assignments.py +++ /dev/null @@ -1,51 +0,0 @@ -from .conf_all import * - -POST_SUBJECT_ASSIGNMENT = { - "subject_assignments":{ - "1":{ - "policy_id": "1", - "subject_id": "2", - "category_id": "1", - "assignments": ["1"] - } - } -} - -DELETE_SUBJECT_ASSIGNMENT = { - "subject_assignments":{ - - } -} - -POST_OTHER_SUBJECT_ASSIGNMENT = { - "subject_assignments":{ - "2":{ - "policy_id": "1", - "subject_id": "2", - "category_id": "1", - "assignments": ["2"] - } - } -} - - -def conf_subject_assignments(m): - m.register_uri( - 'GET', 'http://manager:30001/policies/2/subject_assignments/2/1/1', - [{'headers': {'X-Subject-Token': "111111111"}, 'json': POST_SUBJECT_ASSIGNMENT}, - {'headers': {'X-Subject-Token': "111111111"}, 'json': DELETE_SUBJECT_ASSIGNMENT}] - ) - m.register_uri( - 'GET', 'http://manager:30001/policies/2/subject_assignments/2/1/2', - headers={'X-Subject-Token': "111111111"}, - json=POST_OTHER_SUBJECT_ASSIGNMENT - ) - m.register_uri( - 'POST', 'http://manager:30001/policies/2/subject_assignments', - headers={'X-Subject-Token': "111111111"}, - json=POST_SUBJECT_ASSIGNMENT - ) - m.register_uri( - 'DELETE', 'http://manager:30001/policies/2/subject_assignments/2/1/1', - json=RESULT_OK - )
\ No newline at end of file diff --git a/python_moonclient/tests/unit_python/conf/conf_subject_categories.py b/python_moonclient/tests/unit_python/conf/conf_subject_categories.py deleted file mode 100644 index e59a458a..00000000 --- a/python_moonclient/tests/unit_python/conf/conf_subject_categories.py +++ /dev/null @@ -1,30 +0,0 @@ - -SUBJECT_CATEGORIES = { - "subject_categories": { - "1": { - "name": "subject_cat_1", - "description": "description of the category" - } - } -} - -POST_SUBJECT_CATEGORIES = { - "subject_categories": { - "1": { - "name": "subject_cat_1", - "description": "description of the category" - } - } -} - -def conf_subject_categories(m): - m.register_uri( - 'GET', 'http://manager:30001/subject_categories', - headers={'X-Subject-Token': "111111111"}, - json=SUBJECT_CATEGORIES - ) - m.register_uri( - 'POST', 'http://manager:30001/subject_categories', - headers={'X-Subject-Token': "111111111"}, - json=POST_SUBJECT_CATEGORIES - ) diff --git a/python_moonclient/tests/unit_python/conf/conf_subject_data.py b/python_moonclient/tests/unit_python/conf/conf_subject_data.py deleted file mode 100644 index 19db217d..00000000 --- a/python_moonclient/tests/unit_python/conf/conf_subject_data.py +++ /dev/null @@ -1,67 +0,0 @@ -from .conf_all import * - -SUBJECT_DATA = { - "subject_data":[{ - "policy_id": "1", - "category_id": "1", - "data": { - "1": { - "name": "name of the data", - "description": "description of the data" - } - } - }] -} - -POST_SUBJECT_DATA = { - "subject_data":{ - "policy_id": "1", - "category_id": "1", - "data": { - "1": { - "name": "name of the data", - "description": "description of the data" - } - } - } -} - - -POST_OTHER_SUBJECT_DATA = { - "subject_data":{ - "policy_id": "1", - "category_id": "1", - "data": { - "2": { - "name": "name of the data", - "description": "description of the data" - } - } - } -} - -DELETE_SUBJECT_DATA= { - "subject_data":[{ - "policy_id": "1", - "category_id": "1", - "data":{} - }] -} - - -def conf_subject_data(m): - m.register_uri( - 'POST', 'http://manager:30001/policies/2/subject_data/1', - [{'headers': {'X-Subject-Token': "111111111"}, 'json': POST_SUBJECT_DATA}, - {'headers': {'X-Subject-Token': "111111111"}, 'json': POST_OTHER_SUBJECT_DATA}] - ) - m.register_uri( - 'GET', 'http://manager:30001/policies/2/subject_data/1', - [{'headers': {'X-Subject-Token': "111111111"}, 'json': SUBJECT_DATA}, - {'headers': {'X-Subject-Token': "111111111"}, 'json': DELETE_SUBJECT_DATA}] - ) - m.register_uri( - 'DELETE', 'http://manager:30001/policies/2/subject_data/1/1', - headers={'X-Subject-Token': "111111111"}, - json=RESULT_OK - )
\ No newline at end of file diff --git a/python_moonclient/tests/unit_python/conf/conf_subjects.py b/python_moonclient/tests/unit_python/conf/conf_subjects.py deleted file mode 100644 index bde6093f..00000000 --- a/python_moonclient/tests/unit_python/conf/conf_subjects.py +++ /dev/null @@ -1,112 +0,0 @@ -from .conf_all import * - -SUBJECTS = { - "subjects":{ - "1": { - "name": "name of the subject", - "keystone_id": "1", - "description": "a description", - "policy_list": ["1"] - } - } -} - -SUBJECTS_AFTER_POST= { - "subjects":{ - "1": { - "name": "name of the subject", - "keystone_id": "1", - "description": "a description", - "policy_list": ["1"] - }, - "2": { - "name": "test_subject", - "keystone_id": "1", - "description": "a description", - "policy_list": [] - } - } -} - -SUBJECTS_AFTER_PATCH= { - "subjects":{ - "1": { - "name": "name of the subject", - "keystone_id": "1", - "description": "a description", - "policy_list": ["1"] - }, - "2": { - "name": "test_subject", - "keystone_id": "1", - "description": "a description", - "policy_list": ["2"] - } - } -} - -POST_SUBJECTS = { - "subjects":{ - "2": { - "name": "test_subject", - "keystone_id": "1", - "description": "a description", - "policy_list": [] - } - } -} - - -PATCH_SUBJECTS = { - "subjects":{ - "2": { - "name": "test_subject", - "keystone_id": "1", - "description": "a description", - "policy_list": ["2"] - } - } -} - -def conf_subjects(m): - m.register_uri( - 'GET', 'http://manager:30001/subjects', - [{'json': SUBJECTS, 'headers': {'X-Subject-Token': "111111111"}}, - {'json': SUBJECTS_AFTER_POST, 'headers': {'X-Subject-Token': "111111111"}}, - {'json': SUBJECTS, 'headers': {'X-Subject-Token': "111111111"}}] - ) - m.register_uri( - 'POST', 'http://manager:30001/subjects', - headers={'X-Subject-Token': "111111111"}, - json=POST_SUBJECTS - ) - m.register_uri( - 'DELETE', 'http://manager:30001/subjects/2', - headers={'X-Subject-Token': "111111111"}, - json=RESULT_OK - ) - m.register_uri( - 'PATCH', 'http://manager:30001/policies/2/subjects/2', - headers={'X-Subject-Token': "111111111"}, - json=PATCH_SUBJECTS - ) - m.register_uri( - 'GET', 'http://manager:30001/policies/2/subjects', - headers={'X-Subject-Token': "111111111"}, - json=SUBJECTS_AFTER_PATCH - ) - m.register_uri( - 'POST', 'http://manager:30001/policies/2/subjects', - headers={'X-Subject-Token': "111111111"}, - json=POST_SUBJECTS - ) - m.register_uri( - 'GET', 'http://manager:30001/policies/2/subjects/2', - headers={'X-Subject-Token': "111111111"}, - json=PATCH_SUBJECTS - ) - m.register_uri( - 'DELETE', 'http://manager:30001/policies/2/subjects/2', - headers={'X-Subject-Token': "111111111"}, - json=RESULT_OK - )
\ No newline at end of file |