Ejemplo n.º 1
0
 def test_check_and_create_universe(self):
     test_data_dir = os.path.join(tempfile.mkdtemp(), 'data')
     os.makedirs(test_data_dir)
     spacegame.config.configure(test_data_dir)
     check_and_create_directories()
     check_and_create_universe()
     load_universe()
Ejemplo n.º 2
0
 def test_check_and_create_directories(self):
     test_data_dir = os.path.join(tempfile.mkdtemp(), 'data')
     os.makedirs(test_data_dir)
     spacegame.config.configure(test_data_dir)
     ensure_dirs_exist = [
         spacegame.config.path.universe_dir,
         spacegame.config.path.star_system_dir,
         spacegame.config.path.celestial_dir,
         spacegame.config.path.user_dir,
         spacegame.config.path.player_dir
     ]
     check_and_create_directories()
     for d in ensure_dirs_exist:
         self.assertTrue(os.path.exists(d))