-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix python dependencies * update pytests and adjusted package versions accordingly * format Python
- Loading branch information
Showing
4 changed files
with
21 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
black==23.11.0 | ||
flake8==6.1.0 | ||
mypy==1.7.1 | ||
pytest==7.4.3 | ||
pytest-asyncio==0.23.2 | ||
pytest-cov==4.1.0 | ||
black==24.10.0 | ||
flake8==7.1.0 | ||
mypy==1.13.0 | ||
pytest==8.3.3 | ||
pytest-asyncio==0.24.0 | ||
pytest-cov==6.0.0 | ||
|
||
types-python-jose==3.3.4.8 | ||
|
||
uvicorn[standard]==0.23.2 | ||
uvicorn[standard]==0.32.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,10 @@ | ||
fastapi==0.104.1 | ||
httpx==0.25.2 | ||
python-multipart==0.0.5 | ||
fastapi==0.113.0 | ||
httpx==0.27.2 | ||
python-multipart==0.0.17 | ||
python3-saml==1.16.0 | ||
python-jose[cryptography]==3.3.0 | ||
motor==3.3.2 | ||
pydantic[email]==2.5.2 | ||
motor==3.6.0 | ||
pydantic[email]==2.9.2 | ||
aiosendgrid==0.1.0 | ||
sendgrid==6.11.0 | ||
aiogoogle==5.6.0 | ||
|
||
# To avoid breaking xmlsec for python3-saml | ||
lxml<5.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ | |
from utils.user_record import Applicant, Status | ||
|
||
# Tests will break again next year, tech should notice and fix :P | ||
TEST_DEADLINE = datetime(2024, 10, 1, 8, 0, 0, tzinfo=timezone.utc) | ||
TEST_DEADLINE = datetime(2025, 10, 1, 8, 0, 0, tzinfo=timezone.utc) | ||
user.DEADLINE = TEST_DEADLINE | ||
|
||
USER_EMAIL = "[email protected]" | ||
|
@@ -49,7 +49,7 @@ | |
|
||
EXPECTED_RESUME_UPLOAD = ("pk-fire-69f2afc2.pdf", b"resume", "application/pdf") | ||
SAMPLE_RESUME_URL = HttpUrl("https://drive.google.com/file/d/...") | ||
SAMPLE_SUBMISSION_TIME = datetime(2023, 1, 12, 8, 1, 21, tzinfo=timezone.utc) | ||
SAMPLE_SUBMISSION_TIME = datetime(2024, 1, 12, 8, 1, 21, tzinfo=timezone.utc) | ||
SAMPLE_VERDICT_TIME = None | ||
|
||
EXPECTED_APPLICATION_DATA = ProcessedApplicationData( | ||
|
@@ -88,20 +88,23 @@ | |
|
||
@patch("utils.email_handler.send_application_confirmation_email", autospec=True) | ||
@patch("services.mongodb_handler.update_one", autospec=True) | ||
@patch("routers.user._is_past_deadline", autospec=True) | ||
@patch("routers.user.datetime", autospec=True) | ||
@patch("services.gdrive_handler.upload_file", autospec=True) | ||
@patch("services.mongodb_handler.retrieve_one", autospec=True) | ||
def test_apply_successfully( | ||
mock_mongodb_handler_retrieve_one: AsyncMock, | ||
mock_gdrive_handler_upload_file: AsyncMock, | ||
mock_datetime: Mock, | ||
mock_is_past_deadline: Mock, | ||
mock_mongodb_handler_update_one: AsyncMock, | ||
mock_send_application_confirmation_email: AsyncMock, | ||
) -> None: | ||
"""Test that a valid application is submitted properly.""" | ||
mock_mongodb_handler_retrieve_one.return_value = None | ||
mock_gdrive_handler_upload_file.return_value = SAMPLE_RESUME_URL | ||
mock_datetime.now.return_value = SAMPLE_SUBMISSION_TIME | ||
mock_is_past_deadline.return_value = False | ||
res = client.post("/apply", data=SAMPLE_APPLICATION, files=SAMPLE_FILES) | ||
|
||
mock_gdrive_handler_upload_file.assert_awaited_once_with( | ||
|