class Testlogin(): data = Getdata() username = data.getdata('data', 'username') pwd = data.getdata('data', 'password') address = data.getdata('data', 'address') def test_login(self, username=username, pwd=pwd, address=address): url = f"{address}/api/Access/Login" payload = f'userName={username}&userPwd={pwd}' headers = {'Content-Type': 'application/x-www-form-urlencoded'} response = requests.post(url, headers=headers, data=payload) print(response.json()) t = response.json()['result']['token'] # token = {'token': t} self.data.send_data('token', 'token', t) assert response.status_code == 200 def test_loginout(self): url = f"{self.address}/api/Access/LogOut" response = requests.request("GET", url) assert response.status_code == 200
def setup(self): self.data = Getdata() self.token = self.data.getdata('token', 'token') self.address = self.data.getdata('data', 'address')
orient=HORIZONTAL, length=200, mode='determinate', max=60) progress.pack(padx=30, pady=10) Listbox_sits = Listbox(master, width=40) Listbox_sits.pack(side="left", fill=Y) scrollbar = Scrollbar(master, orient="vertical", command=Listbox_sits.yview) scrollbar.pack(side="right", fill=Y) Listbox_sits.pack() Listbox_sits.config(yscrollcommand=scrollbar.set) getdata = Getdata() def main_Frame(): button_get_sites.configure(command=Get_sites) # <Double-1> for double click Listbox_sits.bind('<Double-1>', onselect) file = 'sites_data.xlsx' global workbook if os.path.exists(file): workbook = openpyxl.load_workbook(file) else: workbook = openpyxl.Workbook()