diff options
| author | Star Rauchenberger <fefferburbia@gmail.com> | 2024-03-15 04:26:00 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-15 09:26:00 +0100 |
| commit | e016228d2b76fa367889c9d98d6eb9e783f98cb4 (patch) | |
| tree | 5c4fd5427ee1c89a832b3327eef6d39d4ce82d82 /test | |
| parent | fcb3b36f44a7d475aa49c5c44971a2b7cabc4ca8 (diff) | |
| download | lingo-apworld-e016228d2b76fa367889c9d98d6eb9e783f98cb4.tar.gz lingo-apworld-e016228d2b76fa367889c9d98d6eb9e783f98cb4.tar.bz2 lingo-apworld-e016228d2b76fa367889c9d98d6eb9e783f98cb4.zip | |
Lingo: Pre-compile datafile to improve loading time (#2829)
Diffstat (limited to 'test')
| -rw-r--r-- | test/TestDatafile.py | 16 |
1 files changed, 16 insertions, 0 deletions
| diff --git a/test/TestDatafile.py b/test/TestDatafile.py new file mode 100644 index 0000000..9f4e9da --- /dev/null +++ b/test/TestDatafile.py | |||
| @@ -0,0 +1,16 @@ | |||
| 1 | import os | ||
| 2 | import unittest | ||
| 3 | |||
| 4 | from worlds.lingo.static_logic import HASHES | ||
| 5 | from worlds.lingo.utils.pickle_static_data import hash_file | ||
| 6 | |||
| 7 | |||
| 8 | class TestDatafile(unittest.TestCase): | ||
| 9 | def test_check_hashes(self) -> None: | ||
| 10 | ll1_file_hash = hash_file(os.path.join(os.path.dirname(__file__), "..", "data", "LL1.yaml")) | ||
| 11 | ids_file_hash = hash_file(os.path.join(os.path.dirname(__file__), "..", "data", "ids.yaml")) | ||
| 12 | |||
| 13 | self.assertEqual(ll1_file_hash, HASHES["LL1.yaml"], | ||
| 14 | "LL1.yaml hash does not match generated.dat. Please regenerate using 'python worlds/lingo/utils/pickle_static_data.py'") | ||
| 15 | self.assertEqual(ids_file_hash, HASHES["ids.yaml"], | ||
| 16 | "ids.yaml hash does not match generated.dat. Please regenerate using 'python worlds/lingo/utils/pickle_static_data.py'") | ||
