Skip to content

Commit

Permalink
change mock datetimes
Browse files Browse the repository at this point in the history
  • Loading branch information
j-c-c committed Oct 21, 2024
1 parent 28783ff commit 5cfc6e2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/test_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ def test_save_overwrite(caplog):

# Case 3: overwrite=None (should rename the existing file and save im3 with original filename)
# Mock datetime to return a fixed timestamp.
mock_datetime_value = datetime(1879, 3, 14, 12, 0, 0)
mock_datetime_value = datetime(2024, 10, 18, 12, 0, 0)
with mock.patch("aspire.utils.misc.datetime") as mock_datetime:
mock_datetime.now.return_value = mock_datetime_value
mock_datetime.strftime = datetime.strftime
Expand Down
2 changes: 1 addition & 1 deletion tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def test_timestamp_filename(caplog):
f.write("Test file")

# Mock datetime to return a fixed timestamp.
mock_datetime_value = datetime(1707, 4, 15, 12, 0, 0)
mock_datetime_value = datetime(2024, 10, 18, 12, 0, 0)
mock_timestamp = mock_datetime_value.strftime("%y%m%d_%H%M%S")

with mock.patch("aspire.utils.misc.datetime") as mock_datetime:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_volume.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ def test_save_overwrite(caplog):

# Case 3: overwrite=None (should rename the existing file and save vol3 with original filename)
# Mock datetime to return a fixed timestamp
mock_datetime_value = datetime(1768, 3, 21, 12, 0, 0)
mock_datetime_value = datetime(2024, 10, 18, 12, 0, 0)
with mock.patch("aspire.utils.misc.datetime") as mock_datetime:
mock_datetime.now.return_value = mock_datetime_value
mock_datetime.strftime = datetime.strftime
Expand Down

0 comments on commit 5cfc6e2

Please sign in to comment.