Exemplo n.º 1
0
    def test_groups_delete_user(self):

        group_id = open_json("test_data_group_user.json")
        test_data = {"id": group_id["id"]}
        url = f"{base_url}?delay=1"
        response = client.delete(url, json=test_data)
        assert response.status_code == 200
Exemplo n.º 2
0
 def test_groups_post_group_not_found(self):
     group_id = open_json("test_data_group.json")
     test_data = {
         "group_id": str(uuid.uuid4()),
         "user": "******",
     }
     url = f"/api/v1/groups/user/create"
     response = client.post(url, json=test_data)
     response = client.post(url, json=test_data)
     assert response.status_code == 404
Exemplo n.º 3
0
 def test_groups_post_two_user_error(self):
     group_id = open_json("test_data_group.json")
     test_data = {
         "group_id": group_id["id"],
         "user": "******",
     }
     url = f"/api/v1/groups/user/create"
     response = client.post(url, json=test_data)
     response = client.post(url, json=test_data)
     assert response.status_code == 400
Exemplo n.º 4
0
    def test_groups_post_user(self):
        group_id = open_json("test_data_group.json")
        test_data = {
            "group_id": group_id["id"],
            "user": "******",
        }
        # save_json("test_data_test_group_user.json", test_data)
        url = f"/api/v1/groups/user/create?delay=1"

        response = client.post(url, json=test_data)
        assert response.status_code == 201
        data = response.json()
        save_json("test_data_group_user.json", data=data)
Exemplo n.º 5
0
    def test_groups_post_two_user(self):
        count = 1
        group_id = open_json("test_data_group.json")

        for _ in range(2):
            test_data = {
                "group_id": group_id["id"],
                "user": f"abc11{count}",
            }
            url = f"/api/v1/groups/user/create"
            count += 1
            response = client.post(url, json=test_data)
            assert response.status_code == 201
Exemplo n.º 6
0
    def test_users_delete_delay(self):
        user_id = open_json("test_data_users.json")

        response = client.delete(f"/api/v1/users/{user_id['user_id']}?delay=1")
        assert response.status_code == 200
Exemplo n.º 7
0
 def test_groups_get_deactivate(self):
     group_id = open_json("test_data_group.json")
     g_id: str = group_id["id"]
     url = f"{base_url}/state?id={g_id}&isActive=false"
     response = client.put(url)
     assert response.status_code == 201
Exemplo n.º 8
0
 def test_groups_get_activate_error_delay(self):
     group_id = open_json("test_data_group.json")
     g_id: str = group_id["id"]
     url = f"{base_url}/state?id={g_id}&delay=122&isActive=true"
     response = client.put(url)
     assert response.status_code == 422
Exemplo n.º 9
0
    def test_todos_delete_delay(self):
        todo_id = open_json(test_data_todos)

        response = client.delete(f"/api/v1/todo/{todo_id['todo_id']}?delay=1")
        assert response.status_code == 200
Exemplo n.º 10
0
    def test_todos_id(self):
        todo_id = open_json(test_data_todos)

        response = client.get(f"/api/v1/todo/{todo_id['todo_id']}")
        assert response.status_code == 200
Exemplo n.º 11
0
    def test_groups_get_group_delay_error(self):
        group_id = open_json("test_data_group.json")
        url = f"/api/v1/groups/group?groupId={group_id['id']}&delay=122"

        response = client.get(url)
        assert response.status_code == 422