Skip to content

Commit

Permalink
Add failing test for --edit-map cmdline option
Browse files Browse the repository at this point in the history
Running "python run_uh.py --edit-map development" on the command line
yields:

    Error: 'development' is not a valid Unknown Horizons map or savegame file.

Broken by the fix for #2507
  • Loading branch information
squiddy committed May 2, 2017
1 parent ad5fc01 commit e87bbde
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/unittests/test_main.py
Expand Up @@ -76,3 +76,15 @@ def test_start_scenario(self, mock_start_singleplayer):
assert options.is_scenario
assert not options.is_map
assert options.game_identifier == 'content/scenarios/tutorial_de.yaml'

@mock.patch('horizons.main.start_singleplayer')
def test_edit_map(self, mock_start_singleplayer):
"""
Test that a specific map can be loaded into the editor from the command line.
"""
self.start_game('--edit-map', 'development')

options = mock_start_singleplayer.call_args[0][0]
assert options.is_map
assert options.is_editor
assert options.game_identifier == 'content/maps/development.sqlite'

0 comments on commit e87bbde

Please sign in to comment.