performance_test.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:voat 作者: Cightline 项目源码 文件源码
def create_test_subvoat(self, count=0):
        api_token = self.get_api_token()

        for x in range(count):

            body  = ''.join(random.choices(string.ascii_letters, k=100))
            title = ''.join(random.choices(string.ascii_letters, k=10))

            result = requests.post('%s/create_subvoat' % (self.base_address), {'subvoat_name':'test_%s' % (title[0:5]),
                                                                              'username':'test_username', 
                                                                              'api_token':api_token,
                                                                              'body':body,
                                                                              'title':title})

            self.check(result)

        #return result.json()['result']


    # test subvoat. 
    # try to create thread without subvoat. 
    # try to create subvoat that already exists
    # try to create subvoat with name length out of parameters (see config.json)
    # try to create subvoat with incorrect api_token
    # try to create subvoat with fake user
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号