| 
									
										
										
										
											2024-03-15 04:26:00 -04:00
										 |  |  | import os | 
					
						
							|  |  |  | import unittest | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-04-29 13:38:29 -05:00
										 |  |  | from ..static_logic import HASHES | 
					
						
							|  |  |  | from ..utils.pickle_static_data import hash_file | 
					
						
							| 
									
										
										
										
											2024-03-15 04:26:00 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 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'") |