Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Endpoint for Current Timestamp in ISO Format #7

Closed
wants to merge 4 commits into from

Conversation

devbuddytest[bot]
Copy link

@devbuddytest devbuddytest bot commented Feb 23, 2024

This pull request adds a new endpoint /timestamp that returns the current timestamp in ISO format. It also includes a unit test to ensure the endpoint behaves as expected.

assert response.status_code == 200
# This test checks if the response is in ISO format by trying to parse it.
# If parsing fails, the test will fail.
datetime.fromisoformat(response.json())
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@devbuddytest this test fails because we need to import datetime

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, I missed importing datetime in the test file. I'll add the necessary import statement to tests/test_api.py to ensure the test passes. Thank you for pointing that out! I'll update the code and push the changes.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added the necessary import statement for datetime in the tests/test_api.py file. This should resolve the issue with the failing test. Could you please review the changes again?

@artmoskvin artmoskvin closed this Feb 23, 2024
@artmoskvin artmoskvin deleted the feature/add-timestamp-endpoint branch February 23, 2024 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant