Skip to content

Commit

Permalink
Test that feeds must have unique names
Browse files Browse the repository at this point in the history
  • Loading branch information
danpalmer committed Jan 4, 2018
1 parent 8b5b93a commit 12aeee9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions routemaster/config/tests/test_loading.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,3 +311,8 @@ def test_raises_for_unparseable_database_port_in_environment_variable():
with mock.patch.dict(os.environ, {'DB_PORT': 'not an int'}):
with assert_config_error(f"Could not parse DB_PORT as an integer: 'not an int'."):
load_config(yaml_data('realistic'))


def test_multiple_feeds_same_name_invalid():
with assert_config_error(f"Feeds must have unique names at state_machines.example.feeds"):
load_config(yaml_data('multiple_feeds_same_name_invalid'))
10 changes: 10 additions & 0 deletions test_data/multiple_feeds_same_name_invalid.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
state_machines:
example:
feeds:
- name: foo
url: http://localhost:8001
- name: foo
url: http://localhost:8002
states:
- gate: start
exit_condition: false

0 comments on commit 12aeee9

Please sign in to comment.