Skip to content

Commit

Permalink
Use freezegun to ensure same creation date
Browse files Browse the repository at this point in the history
  • Loading branch information
ghukill committed Dec 21, 2023
1 parent 56d9a27 commit 1d7a3aa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import boto3
import pytest
from click.testing import CliRunner
from freezegun import freeze_time
from moto import mock_s3

from harvester.aws.sqs import SQSClient, ZipFileEventMessage
Expand Down Expand Up @@ -373,6 +374,7 @@ def strings_from_xpath_unhandled_value():


@pytest.fixture
@freeze_time("2024-01-01")
def records_for_writing(fgdc_source_record_from_zip):
record = Record(
identifier="SDE_DATA_AE_A8GNS_2003",
Expand Down
2 changes: 2 additions & 0 deletions tests/test_harvest/test_harvester.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import pytest
from dateutil.parser import ParserError
from dateutil.tz import tzutc
from freezegun import freeze_time

from harvester.records import FGDC, MITAardvark, Record
from harvester.records.exceptions import FieldMethodError
Expand Down Expand Up @@ -242,6 +243,7 @@ def test_harvester_write_source_metadata_success(
file_obj.write.assert_called_once_with(record.source_record.data)


@freeze_time("2024-01-01")
def test_harvester_write_normalized_metadata_success(
generic_harvester_class, records_for_writing
):
Expand Down

0 comments on commit 1d7a3aa

Please sign in to comment.