Skip to content
This repository has been archived by the owner on Sep 5, 2019. It is now read-only.

Commit

Permalink
Changes core command arguments in test
Browse files Browse the repository at this point in the history
  • Loading branch information
Denis Krienbühl committed May 27, 2016
1 parent 1f223c4 commit e42fcef
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions onegov/town/tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,23 @@ def test_manage_towns(postgres_dsn, temporary_directory):

runner = CliRunner()
result = runner.invoke(cli, [
'--config', cfg_path, '/onegov_town/newyork', 'add', 'New York'
'--config', cfg_path, '--select', '/onegov_town/newyork',
'add', 'New York'
])

assert result.exit_code == 0
assert "New York was created successfully" in result.output

result = runner.invoke(cli, [
'--config', cfg_path, '/onegov_town/newyork', 'add', 'New York'
'--config', cfg_path, '--select', '/onegov_town/newyork',
'add', 'New York'
])

assert result.exit_code == 1
assert "/onegov_town/newyork already contains a town" in result.output
assert "may not reference an existing path" in result.output

result = runner.invoke(cli, [
'--config', cfg_path, '/onegov_town/newyork', 'delete'
'--config', cfg_path, '--select', '/onegov_town/newyork', 'delete'
], input='y\n')

assert result.exit_code == 0
Expand Down

0 comments on commit e42fcef

Please sign in to comment.