def test(): '''Test `garlicsim.asynchronous_crunching`.''' from . import simpacks as simpacks_package # Collecting all the test simpacks: simpacks = import_tools.import_all(simpacks_package).values() # Making sure that we didn't miss any simpack by counting the number of # sub-folders in the `simpacks` folder: simpacks_dir = \ os.path.dirname(simpacks_package.__file__) assert len(path_tools.list_sub_folders(simpacks_dir)) == \ len(simpacks) for simpack in simpacks: test_garlicsim.verify_simpack_settings(simpack) cruncher_types = \ garlicsim.misc.SimpackGrokker(simpack).available_cruncher_types for cruncher_type in cruncher_types: yield check, simpack, cruncher_type
def test_endable(): ''' Test handling of endable simpacks. All simpacks end when they get a world-state with clock reading of 4 or more. ''' from . import simpacks as simpacks_package # Collecting all the test simpacks: simpacks = import_tools.import_all(simpacks_package).values() # Making sure that we didn't miss any simpack by counting the number of # sub-folders in the `simpacks` folder: simpacks_dir = \ os.path.dirname(simpacks_package.__file__) assert len(path_tools.list_sub_folders(simpacks_dir)) == \ len(simpacks) for simpack in simpacks: test_garlicsim.verify_simpack_settings(simpack) cruncher_types = \ garlicsim.misc.SimpackGrokker(simpack).available_cruncher_types for cruncher_type in cruncher_types: yield check, simpack, cruncher_type
def test_simpacks(): from . import simpacks as simpacks_package # Collecting all the test simpacks: simpacks = import_tools.import_all(simpacks_package).values() # Making sure that we didn't miss any simpack by counting the number of # sub-folders in the `simpacks` folder: simpacks_dir = os.path.dirname(simpacks_package.__file__) assert len(path_tools.list_sub_folders(simpacks_dir)) == \ len(simpacks) for simpack in simpacks: test_garlicsim.verify_simpack_settings(simpack) yield check_simpack, simpack
def test_simpacks(): '''Test invalid simpacks.''' from . import simpacks as invalid_simpacks_package # Collecting all the test simpacks: simpacks = list(import_tools.import_all(invalid_simpacks_package).values()) # Making sure that we didn't miss any simpack by counting the number of # sub-folders in the `simpacks` folder: simpacks_dir = \ os.path.dirname(invalid_simpacks_package.__file__) assert len(simpacks) == len( path_tools.list_sub_folders(simpacks_dir, exclude='__pycache__') ) for simpack in simpacks: test_garlicsim.verify_simpack_settings(simpack) yield check_simpack, simpack
def test(): """Test changing things while crunching.""" from . import simpacks as simpacks_package # Collecting all the test simpacks: simpacks = list(import_tools.import_all(simpacks_package).values()) # Making sure that we didn't miss any simpack by counting the number of # sub-folders in the `simpacks` folder: simpacks_dir = os.path.dirname(simpacks_package.__file__) assert len(path_tools.list_sub_folders(simpacks_dir, exclude="__pycache__")) == len(simpacks) for simpack in simpacks: test_garlicsim.verify_simpack_settings(simpack) cruncher_types = garlicsim.misc.SimpackGrokker(simpack).available_cruncher_types for cruncher_type in cruncher_types: yield check, simpack, cruncher_type