Ejemplo n.º 1
0
    def test_get_sessionID(self, get_token_obj, get_sessionID_obj):
        print "Running the test for getting session ID..."
        token = actions.get_token(url=get_token_obj.url,
                                  client_id=get_token_obj.client_id,
                                  client_secret=get_token_obj.client_secret,
                                  grant_type=get_token_obj.grant_type,
                                  ret_type="header")

        res = actions.getSeesionId(token, get_sessionID_obj.url,
                                   get_sessionID_obj.app_user_id)

        print "Verifying the response with the expected output."
        assert res["error_code"] == get_sessionID_obj.error_code
        assert len(res["user"]["id"]) == 32
        assert len(res["user"]["session_id"]) == 32
Ejemplo n.º 2
0
 def test_get_group_infor(self, get_token_obj, get_sessionID_obj,
                          get_group_infor_obj):
     print "Running the test for ask group information.."
     token = actions.get_token(url=get_token_obj.url,
                               client_id=get_token_obj.client_id,
                               client_secret=get_token_obj.client_secret,
                               grant_type=get_token_obj.grant_type,
                               ret_type="header")
     sessionId = actions.getSeesionId(
         token, get_sessionID_obj.url,
         get_sessionID_obj.app_user_id)["user"]["session_id"]
     res = actions.get_group_infor(token, sessionId,
                                   get_group_infor_obj.url,
                                   get_group_infor_obj.groupId)
     print "Verifying the response with the expected output."
     assert res["creator"] == get_group_infor_obj.result_creator
Ejemplo n.º 3
0
    def test_dissolve_group_test(self, get_token_obj, get_sessionID_obj,
                                 dissolve_group_test_obj):
        print "Testing inviting people into a group... Trying to log in first."
        token = actions.get_token(url=get_token_obj.url,
                                  client_id=get_token_obj.client_id,
                                  client_secret=get_token_obj.client_secret,
                                  grant_type=get_token_obj.grant_type,
                                  ret_type="header")
        sessionId = actions.getSeesionId(
            token, get_sessionID_obj.url,
            get_sessionID_obj.app_user_id)["user"]["session_id"]

        res = actions.dissolve_group_test(token, sessionId,
                                          dissolve_group_test_obj.url,
                                          dissolve_group_test_obj.groupId)
        print "Verifying the response with the expected output."
        assert res["error_code"] == dissolve_group_test_obj.error_code
Ejemplo n.º 4
0
    def test_update_group(self, get_token_obj, get_sessionID_obj,
                          update_group_obj):
        print "Running the test for updating group..."
        token = actions.get_token(url=get_token_obj.url,
                                  client_id=get_token_obj.client_id,
                                  client_secret=get_token_obj.client_secret,
                                  grant_type=get_token_obj.grant_type,
                                  ret_type="header")
        sessionId = actions.getSeesionId(
            token, get_sessionID_obj.url,
            get_sessionID_obj.app_user_id)["user"]["session_id"]
        res = actions.update_group(token, sessionId, update_group_obj.url,
                                   update_group_obj.groupId,
                                   update_group_obj.name,
                                   update_group_obj.desc)

        print "Verifying the response with the expected output."
        assert res["error_code"] == update_group_obj.error_code
Ejemplo n.º 5
0
    def test_remove_group_member(self, get_token_obj, get_sessionid_obj,
                                 get_group_obj):
        token = actions.get_token(get_token_obj.url,
                                  client_id=get_token_obj.client_id,
                                  client_secret=get_token_obj.client_secret,
                                  grant_type=get_token_obj.grant_type,
                                  ret_type="header")

        sessionId = actions.getSeesionId(
            token,
            url=get_sessionid_obj.url,
            app_user_id=get_sessionid_obj.app_user_id)

        res = actions.removeGroupMember(token, sessionId["user"]["session_id"],
                                        get_group_obj.url,
                                        get_group_obj.group_id,
                                        get_group_obj.member_v5_id)

        assert res["error_code"] == get_group_obj.err_code
Ejemplo n.º 6
0
    def test_update_nickname(self, get_token_obj, get_sessionID_obj,
                             update_nickname_obj):
        print "Running the test for updating nick name..."
        print "TEST**************************************"
        print update_nickname_obj.app_user_nick_name
        token = actions.get_token(url=get_token_obj.url,
                                  client_id=get_token_obj.client_id,
                                  client_secret=get_token_obj.client_secret,
                                  grant_type=get_token_obj.grant_type,
                                  ret_type="header")
        sessionId = actions.getSeesionId(
            token, get_sessionID_obj.url,
            get_sessionID_obj.app_user_id)["user"]["session_id"]
        res = actions.updateNickname(token, sessionId, update_nickname_obj.url,
                                     update_nickname_obj.app_user_id,
                                     update_nickname_obj.app_user_nick_name)

        print "Verifying the response with the expected output."
        assert res["error_code"] == update_nickname_obj.error_code
Ejemplo n.º 7
0
    def test_create_group_test(self, get_token_obj, get_sessionID_obj,
                               create_group_test_obj):
        print "Testing creating a group... Trying to log in first."
        token = actions.get_token(url=get_token_obj.url,
                                  client_id=get_token_obj.client_id,
                                  client_secret=get_token_obj.client_secret,
                                  grant_type=get_token_obj.grant_type,
                                  ret_type="header")
        sessionId = actions.getSeesionId(
            token, get_sessionID_obj.url,
            get_sessionID_obj.app_user_id)["user"]["session_id"]
        res = actions.create_group_test(
            token,
            sessionId,
            create_group_test_obj.url,
            create_group_test_obj.members_user_id,
            create_group_test_obj.name,
            create_group_test_obj.desc,
        )

        assert res["creator"] == create_group_test_obj.result_creator