Esempio n. 1
0
class MenSuo(unittest.TestCase):
    '''门锁基本信息'''
    def setUp(self):
        self.D = FangYuan()
        self.token = 'QTAxd0hjbEdRQzQlQCVCMDI5OEZFRC0yRDY2LTQ5MEYtQjEwMy0zOTU4RTNDRThGQjclQCUyNTM2MTc1MSVAJTExNTIwJUAlN2IyYWI5YzE5OTVkN2ZlYWZkMTAzOWU1NDAxMGI0ZDA='

    def test_getDoorBaseInfo01(self):
        '''门锁不存在'''
        response = self.D.getDoorBaseInfo(0)
        self.result = response[0]
        self.code = response[1]
        try:
            self.assertEqual(self.result['message'], "门锁不存在")
            self.assertEqual(self.code, 200)
        except:
            logging.info("getCardBint 发生错误")

    def test_getDoorBaseInfo02(self):
        '''doorId传入字符串'''
        response = self.D.getDoorBaseInfo('aa')
        self.result = response[0]
        self.code = response[1]
        try:
            self.assertEqual(self.result['message'], "服务繁忙,请稍后重试")
            self.assertEqual(self.code, 200)
        except:
            logging.info("getCardBint 发生错误")

    def test_getDoorBaseInfo03(self):
        '''您没有权限'''
        response = self.D.getDoorBaseInfo(97)
        self.result = response[0]
        self.code = response[1]
        try:
            self.assertEqual(self.result['message'], "您没有权限")
            self.assertEqual(self.code, 200)
        except:
            logging.info("getCardBint 发生错误")

    def test_getDoorBaseInfo04(self):
        '''success'''
        response = self.D.getDoorBaseInfo(10140)
        self.result = response[0]
        self.code = response[1]
        try:
            self.assertEqual(self.result['message'], "success")
            self.assertEqual(self.code, 200)
        except:
            logging.info("getCardBint 发生错误")
Esempio n. 2
0
class LitDoorOpen(unittest.TestCase):
    '''获取门锁开门记录'''
    def setUp(self):
        self.D = FangYuan()
        self.token = 'QTAxd0hjbEdRQzQlQCVCMDI5OEZFRC0yRDY2LTQ5MEYtQjEwMy0zOTU4RTNDRThGQjclQCUyNTM2MTc1MSVAJTExNTIwJUAlN2IyYWI5YzE5OTVkN2ZlYWZkMTAzOWU1NDAxMGI0ZDA='

    def test_listDoorOpen01(self):
        '''该门锁不存在'''
        response = self.D.listDoorOpen(1018, 10028, 1, 1)
        self.result = response[0]
        self.code = response[1]
        try:
            self.assertEqual(self.result['message'], "该门锁不存在")
            self.assertEqual(self.code, 200)
        except:
            logging.info("getCardBint 发生错误")

    def test_listDoorOpen02(self):
        '''参数doorId不能为 null'''
        response = self.D.listDoorOpen('', '', '', '')
        self.result = response[0]
        self.code = response[1]
        try:
            self.assertEqual(self.result['message'], "参数doorId不能为 null")
            self.assertEqual(self.code, 200)
        except:
            logging.info("getCardBint 发生错误")

    def test_listDoorOpen03(self):
        '''success'''
        response = self.D.listDoorOpen(10189, 10028, 1, 1)
        self.result = response[0]
        self.code = response[1]
        try:
            self.assertEqual(self.result['message'], "success")
            self.assertEqual(self.code, 200)
        except:
            logging.info("getCardBint 发生错误")
Esempio n. 3
0
 def setUp(self):
     self.D = FangYuan()
     self.token = 'QTAxd0hjbEdRQzQlQCVCMDI5OEZFRC0yRDY2LTQ5MEYtQjEwMy0zOTU4RTNDRThGQjclQCUyNTM2MTc1MSVAJTExNTIwJUAlN2IyYWI5YzE5OTVkN2ZlYWZkMTAzOWU1NDAxMGI0ZDA='
Esempio n. 4
0
class FangYuanMenSuo(unittest.TestCase):
    '''房源房间信息'''
    def setUp(self):
        self.D = FangYuan()
        self.token = 'QTAxd0hjbEdRQzQlQCVCMDI5OEZFRC0yRDY2LTQ5MEYtQjEwMy0zOTU4RTNDRThGQjclQCUyNTM2MTc1MSVAJTExNTIwJUAlN2IyYWI5YzE5OTVkN2ZlYWZkMTAzOWU1NDAxMGI0ZDA='

    def test_myHouseList1(self):
        '''获取房源列表'''
        response = self.D.myHouseList1()
        self.result = response[0]
        self.code = response[1]
        try:
            self.assertEqual(self.result['message'], "success")
            self.assertEqual(self.code, 200)
        except:
            logging.info("getCardBint 发生错误")

    def test_getJointRentHouseDetail01(self):
        '''获取合租房子详情,参数为0时'''
        response = self.D.getJointRentHouseDetail1(0)
        self.result = response[0]
        self.code = response[1]
        try:
            self.assertEqual(self.result['message'], "未找到有效房屋")
            self.assertEqual(self.code, 200)
        except:
            logging.info("getCardBint 发生错误")

    def test_getJointRentHouseDetail02(self):
        '''获取合租房子详情,参数为1'''
        response = self.D.getJointRentHouseDetail1(1)
        self.result = response[0]
        self.code = response[1]
        try:
            self.assertEqual(self.result['message'], "success")
            self.assertEqual(self.code, 200)
        except:
            logging.info("getCardBint 发生错误")

    def test_getJointRentHouseDetail03(self):
        '''获取合租房子详情,参数为100时'''
        response = self.D.getJointRentHouseDetail1(100)
        self.result = response[0]
        self.code = response[1]
        try:
            self.assertEqual(self.result['message'], "success")
            self.assertEqual(self.code, 200)
        except:
            logging.info("getCardBint 发生错误")

    def test_listJointRentRoom01(self):
        '''获取合租房间列表,参数为0时'''
        response = self.D.listJointRentRoom1(0)
        self.result = response[0]
        self.code = response[1]
        try:
            self.assertEqual(self.result['message'], "success")
            self.assertEqual(self.code, 200)
        except:
            logging.info("getCardBint 发生错误")

    def test_listJointRentRoom02(self):
        '''获取合租房间列表,参数为678时'''
        response = self.D.listJointRentRoom1(678)
        self.result = response[0]
        self.code = response[1]
        try:
            self.assertEqual(self.result['message'], "success")
            self.assertEqual(self.code, 200)
        except:
            logging.info("getCardBint 发生错误")

    def test_houseDetail1(self):
        '''获取房间详情,参数为0时'''
        response = self.D.houseDetail1(0)
        self.result = response[0]
        self.code = response[1]
        try:
            self.assertEqual(self.result['message'], "未找到有效房源")
            self.assertEqual(self.code, 200)
        except:
            logging.info("getCardBint 发生错误")