コード例 #1
0
    def test_create_group_test2(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_test(
            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.get_seesionId_test(
            token, get_sessionID_obj.url,
            get_sessionID_obj.app_user_id)["user"]["session_id"]

        user_id = ""
        for i in range(0, 500):
            user_id = user_id + "," + "chenying_%d" % i

        res = actions.create_group_test(
            token,
            sessionId,
            create_group_test_obj.url,
            user_id,
            create_group_test_obj.groupInfo["group_name"],
            create_group_test_obj.groupInfo["group_desc"],
        )
コード例 #2
0
    def test_create_group_test1(self, get_token_obj, get_sessionID_obj,
                                create_group_test_obj):
        print "Testing creating a group... Trying to log in first."
        token = {}

        sessionId = ""

        res = actions.create_group_test(
            token,
            sessionId,
            create_group_test_obj.url,
            create_group_test_obj.members_user_id,
            create_group_test_obj.groupInfo["group_name"],
            create_group_test_obj.groupInfo["group_desc"],
        )
コード例 #3
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
コード例 #4
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_test(
         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.get_seesionId_test(
         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.groupInfo["members"],
         create_group_test_obj.groupInfo["group_name"],
         create_group_test_obj.groupInfo["group_desc"],
     )
     #        assert res["error_code"] == create_group_test_obj.error_code
     return res
コード例 #5
0
def create_group():
    print "Test API for create groups..."
    token = eval(request.form.get('token'))
    session = request.form.get('session')
    url_create_group = url + '/open/api/group/create'
    members = request.form.get('members')
    name = request.form.get('group_name')
    desc = request.form.get('group_description')

    print "- Token: %s" % token
    print "- Session: %s" % session
    print "- URL: %s" % url_create_group
    print "- Members: %s" % members
    print "- Group Name: %s" % name
    print "- Group Description: %s" % desc

    try:
        response = actions.create_group_test(token, session, url_create_group,
                                             members, name, desc)
        return str(response)
    except Exception, e:
        print str(e)
        return api_error_message