Skip to content

Commit

Permalink
chore: fix fickle test to not be so time sensitive (#1105)
Browse files Browse the repository at this point in the history
  • Loading branch information
cragwolfe authored Aug 13, 2023
1 parent fa0a5af commit 02af625
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test_unstructured/partition/test_email.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,15 @@ def test_partition_email_can_process_attachments(
assert element.metadata.subject == "Fake email with attachment"

assert elements[-1].text == "Hey this is a fake attachment!"

last_mod_email = datetime.datetime.strptime(
elements[-1].metadata.last_modified,
"%Y-%m-%dT%H:%M:%S",
)
last_mod_text = datetime.datetime.strptime(expected_metadata.last_modified, "%Y-%m-%dT%H:%M:%S")
assert (last_mod_email - last_mod_text).total_seconds() < 2
elements[-1].metadata.last_modified = None
expected_metadata.last_modified = None
assert elements[-1].metadata == expected_metadata


Expand Down

0 comments on commit 02af625

Please sign in to comment.