Tests: Add checksum validation to the postgen datapackage test (#3456)
* Tests: Add checksum validation to the postgen datapackage test * add a special case for the test world datapackage rather than hidden * add the test world to the datapackage instead of special casing around it --------- Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>
This commit is contained in:
parent
0a912808e3
commit
35617bdac5
test/general
|
@ -2,6 +2,7 @@ from argparse import Namespace
|
||||||
from typing import List, Optional, Tuple, Type, Union
|
from typing import List, Optional, Tuple, Type, Union
|
||||||
|
|
||||||
from BaseClasses import CollectionState, Item, ItemClassification, Location, MultiWorld, Region
|
from BaseClasses import CollectionState, Item, ItemClassification, Location, MultiWorld, Region
|
||||||
|
from worlds import network_data_package
|
||||||
from worlds.AutoWorld import World, call_all
|
from worlds.AutoWorld import World, call_all
|
||||||
|
|
||||||
gen_steps = ("generate_early", "create_regions", "create_items", "set_rules", "generate_basic", "pre_fill")
|
gen_steps = ("generate_early", "create_regions", "create_items", "set_rules", "generate_basic", "pre_fill")
|
||||||
|
@ -60,6 +61,10 @@ class TestWorld(World):
|
||||||
hidden = True
|
hidden = True
|
||||||
|
|
||||||
|
|
||||||
|
# add our test world to the data package, so we can test it later
|
||||||
|
network_data_package["games"][TestWorld.game] = TestWorld.get_data_package_data()
|
||||||
|
|
||||||
|
|
||||||
def generate_test_multiworld(players: int = 1) -> MultiWorld:
|
def generate_test_multiworld(players: int = 1) -> MultiWorld:
|
||||||
"""
|
"""
|
||||||
Generates a multiworld using a special Test Case World class, and seed of 0.
|
Generates a multiworld using a special Test Case World class, and seed of 0.
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from Fill import distribute_items_restrictive
|
from Fill import distribute_items_restrictive
|
||||||
|
from worlds import network_data_package
|
||||||
from worlds.AutoWorld import AutoWorldRegister, call_all
|
from worlds.AutoWorld import AutoWorldRegister, call_all
|
||||||
from . import setup_solo_multiworld
|
from . import setup_solo_multiworld
|
||||||
|
|
||||||
|
@ -84,3 +85,4 @@ class TestIDs(unittest.TestCase):
|
||||||
f"{loc_name} is not a valid item name for location_name_to_id")
|
f"{loc_name} is not a valid item name for location_name_to_id")
|
||||||
self.assertIsInstance(loc_id, int,
|
self.assertIsInstance(loc_id, int,
|
||||||
f"{loc_id} for {loc_name} should be an int")
|
f"{loc_id} for {loc_name} should be an int")
|
||||||
|
self.assertEqual(datapackage["checksum"], network_data_package["games"][gamename]["checksum"])
|
||||||
|
|
Loading…
Reference in New Issue