-
Notifications
You must be signed in to change notification settings - Fork 0
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
Created date util #19 #26
Conversation
@@ -150,7 +169,7 @@ def test_post_image_create_endpoint_success(client, mock_data): | |||
assert res.json == build_result( | |||
res.json["url"].split("/")[-1], | |||
entry["real"], | |||
entry["date"], | |||
calculate_date(entry["date"]), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bandaid until my other PR is merged with a better setup for data in the mock FS
imaginate_api/demo.py
Outdated
from ImageHandler import ImageHandler | ||
from schemas.image_info import ImageInfo | ||
from imaginate_api.image_handler import ImageHandler | ||
from imaginate_api.schemas.image_info import ImageInfo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from imaginate_api.schemas.image_info import ImageInfo | |
from image_handler_client.schemas.image_info import ImageInfo |
Since the schema has been moved to that repository
.github/workflows/pipeline.yml
Outdated
@@ -59,7 +59,7 @@ jobs: | |||
envkey_MONGO_TOKEN: ${{ secrets.MONGO_TOKEN }} | |||
file_name: .env | |||
- name: Run tests | |||
run: poetry run pytest --doctest-modules --junitxml=junit/test-results.xml | |||
run: poetry run pytest tests/unit/test_app.py --doctest-modules --junitxml=junit/test-results.xml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
run: poetry run pytest tests/unit/test_app.py --doctest-modules --junitxml=junit/test-results.xml | |
run: poetry run pytest --doctest-modules --junitxml=junit/test-results.xml |
a4fda87
to
60f1a26
Compare
|
||
# helper function that returns a timestamp as an integer, no matter if day is inputed as a timestamp or day # | ||
# WARNING, do not enter a timestamp from BEFORE august 1st 2024. | ||
def calculate_date(day: str | int): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This now takes in a string OR integer, calculates a timestamp and returns it as an integer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 🎉
Overview