Skip to content

Commit

Permalink
update mock
Browse files Browse the repository at this point in the history
  • Loading branch information
wuttinanhi committed Sep 19, 2022
1 parent 75f9ef1 commit 4252396
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 8 deletions.
8 changes: 4 additions & 4 deletions mock/mock.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,20 @@
# mock user
try:
UserService.register("[email protected]", "@Test12345")
except Exception as e:
print("user already registerd!")
except Exception:
pass

# get user
user = UserService.find_by_email("[email protected]")

# mock user car
try:
CarService.register(user, "A11111", "Tesla")
CarService.add(user, "A11111", "Tesla")
except Exception:
pass

try:
CarService.register(user, "A22222", "Starship")
CarService.add(user, "A22222", "Starship")
except Exception:
pass

Expand Down
20 changes: 20 additions & 0 deletions thunder-tests/thunderCollection.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,26 @@
"folders": [],
"settings": {
"headers": [],
"auth": {
"type": "bearer",
"bearer": "{{JWT_TOKEN}}"
},
"tests": [],
"envId": "99e59d5a-e5fa-450f-9cc1-4ade3a66969b"
}
},
{
"_id": "e858eb49-2d8b-4bc5-bc1e-5eb5dcef9be0",
"colName": "car",
"created": "2022-09-19T12:49:24.880Z",
"sortNum": 20000,
"folders": [],
"settings": {
"headers": [],
"auth": {
"type": "bearer",
"bearer": "{{JWT_TOKEN}}"
},
"tests": [],
"envId": "99e59d5a-e5fa-450f-9cc1-4ade3a66969b"
}
Expand Down
11 changes: 11 additions & 0 deletions thunder-tests/thunderEnvironment.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,16 @@
"value": "http://127.0.0.1:5000"
}
]
},
{
"_id": "3a9fa772-d298-4dec-9fa9-cce91bc6bc4d",
"name": "(Local Env)",
"default": false,
"global": true,
"local": true,
"sortNum": -2,
"created": "2022-09-19T12:53:31.598Z",
"modified": "2022-09-19T12:53:31.598Z",
"data": []
}
]
42 changes: 38 additions & 4 deletions thunder-tests/thunderclient.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,46 @@
"method": "GET",
"sortNum": 15000,
"created": "2022-09-19T03:46:58.194Z",
"modified": "2022-09-19T12:37:55.641Z",
"modified": "2022-09-19T13:09:15.749Z",
"headers": [],
"params": [],
"auth": {
"type": "bearer",
"bearer": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoxLCJpYXQiOjE2NjM1OTEwNzAsImV4cCI6MTY2MzU5MTM3MH0.KUcs9JUkJyf-rq0SJICo7diXBNbwhIA0qcxx14_9_XY"
"tests": []
},
{
"_id": "cffa7e72-fc55-4ce3-983a-ad17cf3fc5c1",
"colId": "e858eb49-2d8b-4bc5-bc1e-5eb5dcef9be0",
"containerId": "",
"name": "add",
"url": "{{BASE_API_URL}}/car/add",
"method": "POST",
"sortNum": 10000,
"created": "2022-09-19T12:49:30.945Z",
"modified": "2022-09-19T12:51:14.936Z",
"headers": [],
"params": [],
"body": {
"type": "json",
"raw": "{\n \"car_license_plate\": \"A33333\",\n \"car_type\": \"Falcon9\"\n}\n",
"form": []
},
"tests": []
},
{
"_id": "19ac555e-559e-4408-b444-3290ed496ad4",
"colId": "e858eb49-2d8b-4bc5-bc1e-5eb5dcef9be0",
"containerId": "",
"name": "remove",
"url": "{{BASE_API_URL}}/car/remove",
"method": "DELETE",
"sortNum": 20000,
"created": "2022-09-19T13:00:30.444Z",
"modified": "2022-09-19T13:13:57.167Z",
"headers": [],
"params": [],
"body": {
"type": "json",
"raw": "{\n \"car_id\": 1\n}\n",
"form": []
},
"tests": []
}
Expand Down

0 comments on commit 4252396

Please sign in to comment.