|
@@ -0,0 +1,59 @@
|
|
|
|
+import unittest
|
|
|
|
+
|
|
|
|
+import requests
|
|
|
|
+
|
|
|
|
+from util import req, reqGet, reqForm, reqDelete, reqPut
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+def get_token():
|
|
|
|
+ headers = {
|
|
|
|
+ 'authority': 'edsp.rxdpdev.k5.bigtree.tech',
|
|
|
|
+ 'accept': 'application/json, text/plain, */*',
|
|
|
|
+ 'accept-language': 'zh-CN,zh;q=0.9,en;q=0.8',
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ json_data = {
|
|
|
|
+ 'username': 'jitiantian',
|
|
|
|
+ 'password': 'Aa123456',
|
|
|
|
+ 'token': True,
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ response = requests.post('https://edsp.rxdpdev.k5.bigtree.tech/api/rxdp-auth-web/auth/login', headers=headers, json=json_data)
|
|
|
|
+ return response.json()['token']
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+class MyTest(unittest.TestCase):
|
|
|
|
+
|
|
|
|
+ def setUp(self) -> None:
|
|
|
|
+ # self.host = "https://edsp.rxdpdev.k5.bigtree.tech/api/rxdp-xdata-web/rxdp-file"
|
|
|
|
+ self.host = "http://127.1:8080"
|
|
|
|
+ self.head = {
|
|
|
|
+ "Access-Token": get_token()
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ # 分页
|
|
|
|
+ def test_getTop10FileContentByCode(self):
|
|
|
|
+ reqGet(self.host + "/getTop10FileContentByCode", {"code": "c02bc91d-e13b-4f32-a9ad-266937779ee4"}, self.head)
|
|
|
|
+
|
|
|
|
+ def test_update(self):
|
|
|
|
+ req(self.host + "/rxdp-file/update", {
|
|
|
|
+ "code": "79133359-7217-43b7-a133-891ec276582e",
|
|
|
|
+ "editId": "USR840299609749222148",
|
|
|
|
+ "editTime": "2023-06-21 10:24:55",
|
|
|
|
+ "collectionName": "One",
|
|
|
|
+ "editName": "yanfa",
|
|
|
|
+ "useStatus": "0",
|
|
|
|
+ "cnName": "文件一",
|
|
|
|
+ "createTime": "2023-06-21 10:24:55",
|
|
|
|
+ "createId": "USR840299609749222148",
|
|
|
|
+ "enName": "FIleOne",
|
|
|
|
+ "tenantId": "TENA883826260025957899",
|
|
|
|
+ "id": 2,
|
|
|
|
+ "createName": "yanfa",
|
|
|
|
+ "fileType": "XLSX",
|
|
|
|
+ "fileId": "FID958777541035055623",
|
|
|
|
+ "description": "12321"
|
|
|
|
+ }, self.head)
|
|
|
|
+
|
|
|
|
+ def test_file_list(self):
|
|
|
|
+ reqGet(self.host + "/rxdp-file/list?page=1&limit=10", {}, self.head)
|