Lingo: Pre-compile datafile to improve loading time (#2829)
This commit is contained in:
committed by
GitHub
parent
e534abeab0
commit
afe7aea536
16
worlds/lingo/test/TestDatafile.py
Normal file
16
worlds/lingo/test/TestDatafile.py
Normal file
@@ -0,0 +1,16 @@
|
||||
import os
|
||||
import unittest
|
||||
|
||||
from worlds.lingo.static_logic import HASHES
|
||||
from worlds.lingo.utils.pickle_static_data import hash_file
|
||||
|
||||
|
||||
class TestDatafile(unittest.TestCase):
|
||||
def test_check_hashes(self) -> None:
|
||||
ll1_file_hash = hash_file(os.path.join(os.path.dirname(__file__), "..", "data", "LL1.yaml"))
|
||||
ids_file_hash = hash_file(os.path.join(os.path.dirname(__file__), "..", "data", "ids.yaml"))
|
||||
|
||||
self.assertEqual(ll1_file_hash, HASHES["LL1.yaml"],
|
||||
"LL1.yaml hash does not match generated.dat. Please regenerate using 'python worlds/lingo/utils/pickle_static_data.py'")
|
||||
self.assertEqual(ids_file_hash, HASHES["ids.yaml"],
|
||||
"ids.yaml hash does not match generated.dat. Please regenerate using 'python worlds/lingo/utils/pickle_static_data.py'")
|
||||
Reference in New Issue
Block a user