diff options
Diffstat (limited to 'pygithub3/tests')
-rw-r--r-- | pygithub3/tests/resources/test_core.py | 7 | ||||
-rw-r--r-- | pygithub3/tests/utils/resources.py | 4 |
2 files changed, 10 insertions, 1 deletions
diff --git a/pygithub3/tests/resources/test_core.py b/pygithub3/tests/resources/test_core.py index 1422667..9c05e2b 100644 --- a/pygithub3/tests/resources/test_core.py +++ b/pygithub3/tests/resources/test_core.py @@ -19,6 +19,8 @@ github_return = dict( ) github_return_nested = github_return.copy() github_return.update({'self_nested': github_return_nested}) +github_return.update({'self_nested_list': [github_return_nested] * 2}) +github_return.update({'self_nested_dict': dict(arg1=github_return_nested)}) class TestResourceMapping(TestCase): @@ -53,6 +55,11 @@ class TestResourceMapping(TestCase): self.assertIsInstance(self.r.list_collection[0], HasSimple) self.assertIsInstance(self.r.items_collections['arg1'], HasSimple) + def test_SELF_nested_in_collections(self): + self.assertIsInstance(self.r.self_nested_list[0], Nested) + self.assertIsInstance(self.r.self_nested_dict['arg1'], Nested) + + class TestRawResource(TestCase): """ Litle obvious :P """ diff --git a/pygithub3/tests/utils/resources.py b/pygithub3/tests/utils/resources.py index e03d47d..46a9d53 100644 --- a/pygithub3/tests/utils/resources.py +++ b/pygithub3/tests/utils/resources.py @@ -17,5 +17,7 @@ class Nested(Resource): _maps = {'simple': Simple, 'self_nested': 'self'} _collection_maps = { 'list_collection': HasSimple, - 'items_collections': HasSimple + 'items_collections': HasSimple, + 'self_nested_list': 'self', + 'self_nested_dict': 'self', } |