Skip to content

Commit

Permalink
Add test case for parsing of dict-of-dicts into kwargs.
Browse files Browse the repository at this point in the history
  • Loading branch information
garymacindoe committed Feb 4, 2015
1 parent 7a7320a commit 9e088fc
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test/test_data_dict_dict.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"positive_integer_range": {
"start": 0,
"end": 2,
"value": 1
},
"negative_integer_range": {
"start": -2,
"end": 0,
"value": -1
},
"positive_real_range": {
"start": 0.0,
"end": 1.0,
"value": 0.5
},
"negative_real_range": {
"start": -1.0,
"end": 0.0,
"value": -0.5
}
}
6 changes: 6 additions & 0 deletions test/test_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ def test_greater(self, value):
a, b = value
self.assertGreater(a, b)

@file_data("test_data_dict_dict.json")
def test_file_data_dict_dict(self, start, end, value):
self.assertLess(start, end)
self.assertLess(value, end)
self.assertGreater(value, start)

@file_data('test_data_dict.json')
def test_file_data_dict(self, value):
self.assertTrue(has_three_elements(value))
Expand Down

0 comments on commit 9e088fc

Please sign in to comment.