Skip to content

Commit

Permalink
🐛 fix negation error in metadata_has_changed (#43)
Browse files Browse the repository at this point in the history
the test was also broken :D
  • Loading branch information
hf-kklein authored Feb 19, 2023
1 parent a80a0b9 commit 92b49c1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/edi_energy_scraper/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def _have_different_metadata(data_new_file: bytes, path_to_old_file: Path) -> bo
return True
pdf_old_metadata = pdf_old.metadata

metadata_has_changed: bool = pdf_new_metadata == pdf_old_metadata
metadata_has_changed: bool = pdf_new_metadata != pdf_old_metadata

return metadata_has_changed

Expand Down
6 changes: 3 additions & 3 deletions unittests/test_edienergyscraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,12 +308,12 @@ def test_have_different_metadata(self, datafiles):
# Test that metadata of the same pdf returns same metadata
with open(test_file, "rb") as same_pdf:
has_changed = EdiEnergyScraper._have_different_metadata(same_pdf.read(), test_file)
assert has_changed
assert not has_changed

# Test that metadata of the a different pdf returns different metadata
# Test that metadata of a different pdf returns different metadata
with open(datafiles / "example_ahb_2.pdf", "rb") as different_pdf:
has_changed = EdiEnergyScraper._have_different_metadata(different_pdf.read(), test_file)
assert not has_changed
assert has_changed

def test_remove_no_longer_online_files(self, mocker):
"""Tests function remove_no_longer_online_files."""
Expand Down

0 comments on commit 92b49c1

Please sign in to comment.