def test_save_and_delete(self): bits = Bits() map_dir_path = os.path.join(bits.gas_dir.path, 'world', 'maps', 'gaspy-unit-test-map') self.assertFalse(os.path.exists(map_dir_path)) m = Map( GasDir(map_dir_path), bits, Map.Data(name='gaspy-unit-test-map', screen_name='GasPy UnitTest Map!')) m.save() self.assertTrue(os.path.exists(map_dir_path)) self.assertTrue(os.path.exists(os.path.join(map_dir_path, 'main.gas'))) m.delete() self.assertFalse(os.path.exists(map_dir_path))
def convert_map(m: Map): if not m.get_data().use_node_mesh_index: m.get_data().use_node_mesh_index = True m.save() print(f'Converted map {m.get_data().screen_name} to NMI')