def test_get_corp_tag_list(self): # 获取企业标签库 r = self.company_label.get_corp_tag_list() utils.print_json(r) # assert r.status_code == 200 assert r['errcode'] == 0 assert len(r['tag_group']) > 0
def test_get(self, userid, name, mobile): r = self.member_mengement.create(userid, name, mobile) utils.print_json(r) assert "created" == r['errmsg'] r = self.member_mengement.get(userid) utils.print_json(r) assert 'wangwu' == r['name']
def test_create(self, userid, name, mobile): r = self.member_mengement.create(userid, name, mobile) utils.print_json(r) assert "created" == r['errmsg'] # 添加之后获取一下看是否添加成功 r = self.member_mengement.get(userid) assert name == r['name']
def test_update(self, userid, name, mobile): r = self.member_mengement.create(userid, name, mobile) assert "created" == r['errmsg'] r = self.member_mengement.update(userid, "echo13", mobile) utils.print_json(r) assert 'updated' == r['errmsg'] r = self.member_mengement.get(userid) utils.print_json(r) assert "echo13" == r['name']
def test_add_corp_tag(self): # 方法一:加上时间戳保证测试数据的唯一性 # 方法二:维护可重复使用的测试数据 # group_name = 'group_普通客户' # tag_name = 'name_砖石' # r = self.wework.add_corp_tag(group_name,tag_name) group_name = 'group_普通客户11111' tag_name = 'name_砖石1111111' r = self.company_label.add_corp_tag(group_name,tag_name) assert r['errcode'] == 0 # 添加之后获取tag_id tag_id = self.company_label.get_group_tag_id_by_name(tag_name=tag_name) utils.print_json(r) # 添加完成之后需要断言是否添加成功 assert tag_id != None
def test_del_corp_tag(self,group_name,tag_name): # 先添加一个标签 r = self.company_label.add_corp_tag(group_name,tag_name) # 添加之后获取tag_id tag_id = self.company_label.get_group_tag_id_by_name(tag_name=tag_name) utils.print_json(r) # 添加完成之后需要断言是否添加成功 assert tag_id != None # 删除指定tag_id的标签 r = self.company_label.del_corp_tag(tag_id=tag_id) # 删除之后获取tag_id tag_id = self.company_label.get_group_tag_id_by_name(tag_name=tag_name) utils.print_json(r) # 删除成功之后断言 assert r['errcode'] == 0 assert tag_id == None