File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -183,4 +183,6 @@ Contributors
183183
184184- Tigran Tchougourian (@NargiT)
185185
186- - Dimitri Merejkowsky (@dmerejkowsky)
186+ - Samuel Mendes (@smendes)
187+
188+ - Dimitri Merejkowsky (@dmerejkowsky)
Original file line number Diff line number Diff line change @@ -54,9 +54,10 @@ def _update_attributes(self, json):
5454
5555 def __getattr__ (self , attribute ):
5656 """Proxy access to stored JSON."""
57- if attribute not in self ._json_data :
57+ _json_data = object .__getattribute__ (self , "_json_data" )
58+ if attribute not in _json_data :
5859 raise AttributeError (attribute )
59- value = self . _json_data . get ( attribute )
60+ value = _json_data [ attribute ]
6061 setattr (self , attribute , value )
6162 return value
6263
Original file line number Diff line number Diff line change 33import pytest
44import requests
55
6+ from copy import copy
67from datetime import datetime , timedelta
78from github3 import exceptions , GitHubError
89from github3 .models import GitHubCore
@@ -206,6 +207,10 @@ def test_strptime_time_str_required(self):
206207 """Verify that method converts ISO 8601 formatted string."""
207208 assert self .instance ._strptime ("" ) is None
208209
210+ def test_can_be_copied (self ):
211+ """Verify that a GithubCore object can be copied."""
212+ assert copy (self .instance ) is not None
213+
209214
210215class TestGitHubCoreIssue672 (helper .UnitHelper ):
211216
You can’t perform that action at this time.
0 commit comments