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

Commit

Permalink
Fix failing tests from previous clive fix
Browse files Browse the repository at this point in the history
I changed clive so that it showed something like TOP->foo->bar instead
of TOP:foo:bar because : was being used as a delimiter between fields.

I screwed up and pushed the fix without testing it. This fixes the tests
accordingly.
  • Loading branch information
willkg committed Jun 3, 2016
1 parent c671777 commit 6da32a5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/tests/test_schemalib.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def test_subtype(self):
def test_bad_subtype(self):
assert (
DictOfT({'foo': IntT()}).validate({'foo': 'bar'}, '') ==
[Result(ERROR, 0, 0, ':foo', 'value is not a valid int: %r' % 'bar')]
[Result(ERROR, 0, 0, '->foo', 'value is not a valid int: %r' % 'bar')]
)

def test_unknown_keys(self):
Expand All @@ -250,14 +250,14 @@ def test_unknown_keys(self):
def test_depth(self):
assert (
DictOfT({'foo': IntT()}).validate({'foo': 'bar'}, 'TOP') ==
[Result(ERROR, 0, 0, 'TOP:foo', 'value is not a valid int: %r' % 'bar')]
[Result(ERROR, 0, 0, 'TOP->foo', 'value is not a valid int: %r' % 'bar')]
)

def test_recursion(self):
assert DictOfT({'foo': DictOfT({'bar': IntT()})}).validate({'foo': {'bar': 5}}, 'TOP') == []
assert (
DictOfT({'foo': DictOfT({'bar': IntT()})}).validate({'foo': {'bar': 'baz'}}, 'TOP') ==
[Result(ERROR, 0, 0, 'TOP:foo:bar', 'value is not a valid int: %r' % 'baz')]
[Result(ERROR, 0, 0, 'TOP->foo->bar', 'value is not a valid int: %r' % 'baz')]
)

req = DictOfT({
Expand All @@ -278,7 +278,7 @@ def test_recursion(self):
assert (
sort_results(req.validate(data, 'TOP')) ==
sort_results([
Result(ERROR, 0, 0, 'TOP:bar', 'value is not a valid int: %r' % 'foo1'),
Result(ERROR, 0, 0, 'TOP:baz:key', 'value is not a valid int: %r' % 'foo2'),
Result(ERROR, 0, 0, 'TOP->bar', 'value is not a valid int: %r' % 'foo1'),
Result(ERROR, 0, 0, 'TOP->baz->key', 'value is not a valid int: %r' % 'foo2'),
])
)

0 comments on commit 6da32a5

Please sign in to comment.