quivr/backend/tests/test_user_controller.py
Stan Girard d955e31f50
feat: 🎸 marketplace (#1657)
added explore button and removed unused feature openai key

# Description

Please include a summary of the changes and the related issue. Please
also include relevant motivation and context.

## Checklist before requesting a review

Please delete options that are not relevant.

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my code
- [ ] I have commented hard-to-understand areas
- [ ] I have ideally added tests that prove my fix is effective or that
my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged

## Screenshots (if appropriate):
2023-11-19 18:46:12 +01:00

35 lines
1.1 KiB
Python

def test_get_user_info(client, api_key):
# Send a request to get user information
response = client.get("/user", headers={"Authorization": "Bearer " + api_key})
# Assert that the response status code is 200 (HTTP OK)
assert response.status_code == 200
# Assert that the response contains the expected fields
user_info = response.json()
print(user_info)
assert "email" in user_info
assert "max_brain_size" in user_info
assert "current_brain_size" in user_info
assert "date" in user_info
assert "is_premium" in user_info
assert "models" in user_info
assert "requests_stats" in user_info
assert "id" in user_info
def test_get_user_identity(client, api_key):
# Send a request to get user identity
response = client.get(
"/user/identity", headers={"Authorization": "Bearer " + api_key}
)
# Assert that the response status code is 200 (HTTP OK)
assert response.status_code == 200
# Assert that the response contains the expected fields
user_identity = response.json()
print(user_identity)
assert "id" in user_identity
assert "email" in user_identity