This repository was archived by the owner on May 22, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -181,4 +181,6 @@ Contributors
181
181
182
182
- Steven Nyman (@stevennyman)
183
183
184
- - Tigran Tchougourian (@NargiT)
184
+ - Tigran Tchougourian (@NargiT)
185
+
186
+ - Samuel Mendes (@smendes)
Original file line number Diff line number Diff line change @@ -54,9 +54,10 @@ def _update_attributes(self, json):
54
54
55
55
def __getattr__ (self , attribute ):
56
56
"""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 :
58
59
raise AttributeError (attribute )
59
- value = self . _json_data . get ( attribute )
60
+ value = _json_data [ attribute ]
60
61
setattr (self , attribute , value )
61
62
return value
62
63
Original file line number Diff line number Diff line change 3
3
import pytest
4
4
import requests
5
5
6
+ from copy import copy
6
7
from datetime import datetime , timedelta
7
8
from github3 import exceptions , GitHubError
8
9
from github3 .models import GitHubCore
@@ -206,6 +207,10 @@ def test_strptime_time_str_required(self):
206
207
"""Verify that method converts ISO 8601 formatted string."""
207
208
assert self .instance ._strptime ("" ) is None
208
209
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
+
209
214
210
215
class TestGitHubCoreIssue672 (helper .UnitHelper ):
211
216
You can’t perform that action at this time.
0 commit comments