def test_del_supervisor_room_id_error(self): """ 测试请求取消管理接口房间ID不存在,可以成功 :return: """ add_supervisor_ajax = AddSupervisorAjax(self.anchor_mobile) add_supervisor_ajax.get({ 'room_id': self.room_id, 'anchor_id': self.anchor_id, 'user_id': self.user_id, 'type': '60' }) self.assertEqual(add_supervisor_ajax.get_resp_code(), 0) super_visor_details = MysqlOperation( user_id=self.user_id).get_anchor_room_supervisor_details() self.assertEqual(super_visor_details['is_advance_admin'], 1) del_supervisor_ajax = DelSupervisorAjax(self.anchor_mobile) del_supervisor_ajax.get({ 'room_id': '909090', 'anchor_id': self.anchor_id, 'user_id': self.user_id }) self.assertEqual(del_supervisor_ajax.get_resp_code(), 0)
def test_del_supervisor_60_success(self): """ 测试主播取消高管成功 :return: """ add_supervisor_ajax = AddSupervisorAjax(self.anchor_mobile) add_supervisor_ajax.get({ 'room_id': self.room_id, 'anchor_id': self.anchor_id, 'user_id': self.user_id, 'type': '60' }) self.assertEqual(add_supervisor_ajax.get_resp_code(), 0) super_visor_details = MysqlOperation( user_id=self.user_id).get_anchor_room_supervisor_details() self.assertEqual(super_visor_details['is_advance_admin'], 1) del_supervisor_ajax = DelSupervisorAjax(self.anchor_mobile) del_supervisor_ajax.get({ 'room_id': self.room_id, 'anchor_id': self.anchor_id, 'user_id': self.user_id }) self.assertEqual(del_supervisor_ajax.get_resp_code(), 0) super_visor_details = MysqlOperation( user_id=self.user_id).get_anchor_room_supervisor_details() self.assertIsNone(super_visor_details)
def tearDown(self, user_id=None, anchor_id=None): super(TestSupervisorAjaxAbnormal, self).tearDown() del_supervisor_ajax = DelSupervisorAjax(self.anchor_mobile) del_supervisor_ajax.get({ 'room_id': self.room_id, 'anchor_id': self.anchor_id, 'user_id': self.user_id })
def setUp(self, user_id=None, anchor_id=None): super(TestSupervisorAjax, self).setUp() del_supervisor_ajax = DelSupervisorAjax(self.anchor_mobile) del_supervisor_ajax.get({ 'room_id': self.room_id, 'anchor_id': self.anchor_id, 'user_id': self.user_id })
def tearDown(self, user_id=None, anchor_id=None): super(TestBlackUserAjaxUserToHighAdmin, self).tearDown() del_supervisor_ajax = DelSupervisorAjax(self.anchor_mobile) del_supervisor_ajax.get({ 'room_id': self.room_id, 'anchor_id': self.anchor_id, 'user_id': self.admin_user_id })
def setUp(self, user_id=None, anchor_id=None): super(TestBlackUserAjaxUserToNorAdmin, self).setUp() del_supervisor_ajax = DelSupervisorAjax(self.anchor_mobile) del_supervisor_ajax.get({ 'room_id': self.room_id, 'anchor_id': self.anchor_id, 'user_id': self.admin_user_id })
def test_del_supervisor_user_id_error(self): """ 测试请求取消管理接口用户ID不存在 :return: """ del_supervisor_ajax = DelSupervisorAjax(self.anchor_mobile) del_supervisor_ajax.get({ 'room_id': self.room_id, 'anchor_id': self.anchor_id, 'user_id': '90909090' }) self.assertEqual(del_supervisor_ajax.get_resp_code(), 801027) self.assertEqual(del_supervisor_ajax.get_resp_message(), '用户信息不存在')
def test_del_supervisor_user_id_null(self): """ 测试请求取消管理接口用户ID为空 :return: """ del_supervisor_ajax = DelSupervisorAjax(self.anchor_mobile) del_supervisor_ajax.get({ 'room_id': self.room_id, 'anchor_id': self.anchor_id, 'user_id': None }) self.assertEqual(del_supervisor_ajax.get_resp_code(), 801020) self.assertEqual(del_supervisor_ajax.get_resp_message(), '用户id不能为空')
def test_del_supervisor_anchor_id_null(self): """ 测试请求取消管理接口主播ID为空 :return: """ del_supervisor_ajax = DelSupervisorAjax(self.anchor_mobile) del_supervisor_ajax.get({ 'room_id': self.room_id, 'anchor_id': None, 'user_id': self.user_id }) self.assertEqual(del_supervisor_ajax.get_resp_code(), 402005) self.assertEqual(del_supervisor_ajax.get_resp_message(), '主播ID不能为空')