Пример #1
0
 def delete(self, id=None):
     self.json_data = requests.get(self.delete_url,
                                   params={
                                       "access_token": WeWork.get_token(),
                                       "id": id
                                   }).json()
     self.verbose(self.json_data)
     return self.json_data
Пример #2
0
 def list(self, id):
     self.json_data = requests.get(self.list_url,
                                   params={
                                       "access_token": WeWork.get_token(),
                                       "id": id
                                   }).json()
     self.verbose(self.json_data)
     return self.json_data
Пример #3
0
 def update(self, id, name, parentid, order):
     self.json_data = requests.post(self.update_url,
                                    headers=self.headers,
                                    params={
                                        "access_token": WeWork.get_token()
                                    },
                                    json={
                                        "id": id,
                                        "name": name,
                                        "parentid": parentid,
                                        "order": order
                                    }).json()
     self.verbose(self.json_data)
     return self.json_data
Пример #4
0
 def test_get_token(self):
     wework = WeWork()
     token = wework.get_token()
     assert token != None
Пример #5
0
 def creat(self, name, parentid, order):
     self.json_data=requests.post(self.creat_url,headers=self.headers,params={"access_token":WeWork.get_token()},json={
         "name": name,
         "parentid": parentid,
         "order": order,
         "id": None
     }
     # ,
     # # proxies=self.proxies,verify=False
                       )\
         .json()
     self.verbose(self.json_data)
     return self.json_data