Skip to content

Commit

Permalink
Fix unit test for the '_IncludeFields' method.
Browse files Browse the repository at this point in the history
  • Loading branch information
przemekwitek authored Nov 2, 2016
1 parent a18c0af commit 529614a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions apitools/base/py/encoding_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,12 @@ def testNestedIncludeFields(self):
self.assertEqual(
'{"nested": {"nested": null}}',
encoding.MessageToJson(msg, include_fields=['nested.nested']))
self.assertEqual(
'{"nested": {"nested_list": []}}',
encoding.MessageToJson(msg, include_fields=['nested.nested_list']))
# When clearing 'nested.nested_list', its sibling ('nested.nested')
# should remain unaffected.
self.assertIn(
encoding.MessageToJson(msg, include_fields=['nested.nested_list']),
['{"nested": {"nested": {}, "nested_list": []}}',
'{"nested": {"nested_list": [], "nested": {}}}'])
self.assertEqual(
'{"nested": {"nested": {"additional_properties": []}}}',
encoding.MessageToJson(
Expand Down

0 comments on commit 529614a

Please sign in to comment.