|
@@ -0,0 +1,35 @@
|
|
|
+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.rxdptest.k5.bigtree.tech/api/rxdp-tag"
|
|
|
+ self.host = "http://127.1:8081"
|
|
|
+ self.head = {
|
|
|
+ "Access-Token": 'eyJhbGciOiJIUzUxMiJ9.eyJqdGkiOiI5Mzk0ODU0MTU1MjQ1OTI0NzciLCJzdWIiOiJ7XCJ1c2VybmFtZVwiOlwieWFuZmFcIn0iLCJpYXQiOjE2ODc3NzA3ODEsImF1ZCI6ImJpZ3RyZWUiLCJleHAiOjE2ODc4NjA3ODF9.JbkdpOZSPzMpeg4rSMmR6S6rkJsSf6oxJVRdMYFWTgl9BqJgVMgYE7liOkQBHDwJGVvkSNrTf-RNSejr6_zIjA'
|
|
|
+ }
|
|
|
+
|
|
|
+ def test_file_list(self):
|
|
|
+ reqGet(self.host + "/make/list?page=1&limit=10", {}, self.head)
|