tests/test_dateparser_data_integrity.py
raw| 1 | import pytest |
| 2 | |
| 3 | pytest.importorskip("ruamel") |
| 4 | |
| 5 | from dateparser_scripts.write_complete_data import write_complete_data |
| 6 | |
| 7 | |
| 8 | def test_dateparser_data_integrity(): |
| 9 | files = write_complete_data(in_memory=True) |
| 10 | |
| 11 | for filename in files: |
| 12 | with open(filename, "rb") as f: |
| 13 | assert f.read().strip() == files[filename].strip(), ( |
| 14 | 'The content of the file "{}" doesn\'t match the content' |
| 15 | " of the generated file.".format(filename) |
| 16 | ) |