-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_auth.py
More file actions
35 lines (28 loc) · 788 Bytes
/
Copy pathtest_auth.py
File metadata and controls
35 lines (28 loc) · 788 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env python3
"""
Test script to verify authentication is working
"""
import requests
import json
def test_login():
url = "http://localhost:8000/auth/login"
data = {
"username": "julie",
"password": "PVS12345"
}
try:
response = requests.post(url, json=data)
print(f"Status Code: {response.status_code}")
print(f"Response: {response.text}")
if response.status_code == 200:
print("✓ Authentication successful!")
return True
else:
print("✗ Authentication failed!")
return False
except Exception as e:
print(f"Error testing login: {e}")
return False
if __name__ == "__main__":
print("Testing authentication...")
test_login()