def brokerVip(self): ''' 查询vip模块 :return: ''' url = '/brokerVip/vipInfoList' headers = {'Authorization': base().token()} s = self.client.get(url, headers=headers) print(s.json())
def linker(self): ''' 全部楼盘模块 :return: ''' url = '/linker/getLinkerList' headers = {'Authorization': base().token()} params = {"size": 10, "current": 1, "city": "全国"} s = self.client.get(url, params=params, headers=headers) print(s.json()['data']['total'])
class WebsiteUser(HttpLocust): task_set = WebsiteTasks min_wait = 0 max_wait = 1 host = base().url()
def testBase(self): b = common.base('hi') self.assertEqual(b.elt, 'hi')
def testBase (self): b = common.base('hi') self.assertEqual(b.elt, 'hi')
def GetTemp(IdSensor=0): if hostname in testhost: return random.randint(40, 50) parametr = ' -t %d -q -o "%%.2C" -c /home/nimda/.digitemprc' % (IdSensor) command = DigiTemp + parametr try: process = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE) process.wait() out = process.communicate()[0] return float(out) except ValueError: return -100 if __name__ == "__main__": tempBase = common.base(host="localhost", base="heating", user="******", password="******") isWork = True if hostname in testhost: isWork = False print GetTemp(0) while isWork: curTemp = GetTemp(0) tempBase.addTempToBase(curTemp) print curTemp time.sleep(TimeOut) tempDate = tempBase.getTempFromBase() print tempDate[0].strftime("%x %X"), print tempDate[1]
# To change this template, choose Tools | Templates # and open the template in the editor. __author__="ilyas" __date__ ="$29.01.2011 2:24:54$" import common, datetime if __name__ == "__main__": b = common.base(host = 'localhost', base='heating', user='******', password='******') r = b.getLastLineFromTable("temperature", 10) for i in r: print i[0], if i[1] != None: print i[1].strftime('%x %X'), else: print "None", print i[2] tempDate = b.getTempFromBase() print datetime.datetime.now() if True : print b.user # print tempDate[0].strftime('%x %X'), # print tempDate[1]
def GetMinMaxInDay(): b = common.base(host = 'localhost', base='heating', user='******', password='******') return b.getMinMaxInDay()
def GetTemp(IdSensor = 0): b = common.base(host = 'localhost', base='heating', user='******', password='******') return b.getTempFromBase()