Skip to content

Commit

Permalink
More context tests
Browse files Browse the repository at this point in the history
  • Loading branch information
danpalmer committed Jan 4, 2018
1 parent 62eeacf commit fd73449
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions routemaster/tests/test_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,25 @@ def test_only_loads_feed_once():
context.lookup(('feeds', 'example', 'baz'))

assert json.call_count == 1


def test_non_existent_feed_is_none():
context = Context(
'label1',
{},
UTC_NOW,
{},
['feeds.foo.bar'],
)
assert context.lookup(['feeds', 'foo', 'bar']) is None


def test_accessing_prefix_directly_does_not_error():
context = Context(
'label1',
{},
UTC_NOW,
{},
['metadata'],
)
assert context.lookup(['metadata']) == {}

0 comments on commit fd73449

Please sign in to comment.