diff options
author | ahmed.helmy <ahmad.helmy@orange.com> | 2018-04-05 15:41:37 +0200 |
---|---|---|
committer | Duval Thomas <thomas.duval@orange.com> | 2018-05-09 11:27:35 +0200 |
commit | 5dffe7e0889dd76885d313c1d44a4b389f4b8667 (patch) | |
tree | 6ff2f953ee16392bf6c0914744af258d61a237fa /moon_manager/tests/unit_python/api/meta_data_test.py | |
parent | 1c249823b9a15d4dd3e2e5eae90c09131bc7f09b (diff) |
continue integrating validation
Change-Id: Ifbda169affd649f9125581ac5b688b509d1f0d82
Signed-off-by: ahmed.helmy <ahmad.helmy@orange.com>
Diffstat (limited to 'moon_manager/tests/unit_python/api/meta_data_test.py')
-rw-r--r-- | moon_manager/tests/unit_python/api/meta_data_test.py | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/moon_manager/tests/unit_python/api/meta_data_test.py b/moon_manager/tests/unit_python/api/meta_data_test.py index 0d67a8cd..8609f0b5 100644 --- a/moon_manager/tests/unit_python/api/meta_data_test.py +++ b/moon_manager/tests/unit_python/api/meta_data_test.py @@ -54,6 +54,20 @@ def test_add_subject_categories(): assert value['description'] == "description of {}".format("testuser") +def test_add_subject_categories_with_empty_user(): + client = utilities.register_client() + req, subject_categories = add_subject_categories(client, "") + assert req.status_code == 500 + assert json.loads(req.data)["message"] == "Empty String" + + +def test_add_subject_categories_with_user_contain_space(): + client = utilities.register_client() + req, subject_categories = add_subject_categories(client, "test user") + assert req.status_code == 500 + assert json.loads(req.data)["message"] == "String contains space" + + def test_delete_subject_categories(): client = utilities.register_client() req = delete_subject_categories(client, "testuser") @@ -119,6 +133,20 @@ def test_add_object_categories(): assert value['description'] == "description of {}".format("testuser") +def test_add_object_categories_with_empty_user(): + client = utilities.register_client() + req, object_categories = add_object_categories(client, "") + assert req.status_code == 500 + assert json.loads(req.data)["message"] == "Empty String" + + +def test_add_object_categories_with_user_contain_space(): + client = utilities.register_client() + req, object_categories = add_object_categories(client, "test user") + assert req.status_code == 500 + assert json.loads(req.data)["message"] == "String contains space" + + def test_delete_object_categories(): client = utilities.register_client() req = delete_object_categories(client, "testuser") @@ -184,6 +212,20 @@ def test_add_action_categories(): assert value['description'] == "description of {}".format("testuser") +def test_add_action_categories_with_empty_user(): + client = utilities.register_client() + req, action_categories = add_action_categories(client, "") + assert req.status_code == 500 + assert json.loads(req.data)["message"] == "Empty String" + + +def test_add_action_categories_with_user_contain_space(): + client = utilities.register_client() + req, action_categories = add_action_categories(client, "test user") + assert req.status_code == 500 + assert json.loads(req.data)["message"] == "String contains space" + + def test_delete_action_categories(): client = utilities.register_client() req = delete_action_categories(client, "testuser") |