File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ def _update_attributes(self, content):
5353
5454 # content, base64 encoded and decoded
5555 #: Base64-encoded content of the file.
56- self .content = content .get ('content' , '' )
56+ self .content = content .get ('content' )
5757
5858 #: Decoded content of the file as a bytes object. If we try to decode
5959 #: to character set for you, we might encounter an exception which
@@ -62,7 +62,7 @@ def _update_attributes(self, content):
6262 #: with the character set you wish to use, e.g.,
6363 #: ``content.decoded.decode('utf-8')``.
6464 #: .. versionchanged:: 0.5.2
65- self .decoded = b''
65+ self .decoded = self . content
6666 if self .encoding == 'base64' and self .content :
6767 self .decoded = b64decode (self .content .encode ())
6868
Original file line number Diff line number Diff line change @@ -199,6 +199,8 @@ def test_directory_contents(self):
199199 for (filename , content ) in contents :
200200 assert content .name == filename
201201 assert isinstance (content , github3 .repos .contents .Contents )
202+ assert content .content is None
203+ assert content .decoded is None
202204
203205 def test_events (self ):
204206 """Test that a user can iterate over the events from a repository."""
@@ -220,6 +222,8 @@ def test_file_contents(self):
220222 contents = repository .file_contents ('github3/repos/repo.py' )
221223
222224 assert isinstance (contents , github3 .repos .contents .Contents )
225+ assert contents .content is not None
226+ assert contents .decoded is not None
223227
224228 def test_forks (self ):
225229 """Test that a user can iterate over the forks of a repository."""
You can’t perform that action at this time.
0 commit comments