Tests: now autoload tests from /worlds/*/test (#1318)
Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>
This commit is contained in:
		
							
								
								
									
										23
									
								
								worlds/rogue_legacy/test/TestUnique.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								worlds/rogue_legacy/test/TestUnique.py
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,23 @@ | ||||
| from typing import Dict | ||||
|  | ||||
| from . import RLTestBase | ||||
| from worlds.rogue_legacy.Items import RLItemData, item_table | ||||
| from worlds.rogue_legacy.Locations import RLLocationData, location_table | ||||
|  | ||||
|  | ||||
| class UniqueTest(RLTestBase): | ||||
|     @staticmethod | ||||
|     def test_item_ids_are_all_unique(): | ||||
|         item_ids: Dict[int, str] = {} | ||||
|         for name, data in item_table.items(): | ||||
|             assert data.code not in item_ids.keys(), f"'{name}': {data.code}, is not unique. " \ | ||||
|                                                      f"'{item_ids[data.code]}' also has this identifier." | ||||
|             item_ids[data.code] = name | ||||
|  | ||||
|     @staticmethod | ||||
|     def test_location_ids_are_all_unique(): | ||||
|         location_ids: Dict[int, str] = {} | ||||
|         for name, data in location_table.items(): | ||||
|             assert data.code not in location_ids.keys(), f"'{name}': {data.code}, is not unique. " \ | ||||
|                                                          f"'{location_ids[data.code]}' also has this identifier." | ||||
|             location_ids[data.code] = name | ||||
							
								
								
									
										5
									
								
								worlds/rogue_legacy/test/__init__.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								worlds/rogue_legacy/test/__init__.py
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,5 @@ | ||||
| from test.TestBase import WorldTestBase | ||||
|  | ||||
|  | ||||
| class RLTestBase(WorldTestBase): | ||||
|     game = "Rogue Legacy" | ||||
		Reference in New Issue
	
	Block a user
	 Fabian Dill
					Fabian Dill