Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3c730da

Browse files
committed
Remove Repository#contents and its tests
1 parent6315253 commit3c730da

File tree

2 files changed

+0
-51
lines changed

2 files changed

+0
-51
lines changed

‎github3/repos/repo.py‎

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -563,32 +563,6 @@ def compare_commits(self, base, head):
563563
json=self._json(self._get(url),200)
564564
returnself._instance_or_null(Comparison,json)
565565

566-
defcontents(self,path,ref=None):
567-
"""Get the contents of the file pointed to by ``path``.
568-
569-
If the path provided is actually a directory, you will receive a
570-
dictionary back of the form::
571-
572-
{
573-
'filename.md': Contents(), # Where Contents an instance
574-
'github.py': Contents(),
575-
}
576-
577-
:param str path: (required), path to file, e.g.
578-
github3/repos/repo.py
579-
:param str ref: (optional), the string name of a commit/branch/tag.
580-
Default: master
581-
:returns: :class:`~github3.repos.contents.Contents` or dict
582-
if successful, else None
583-
"""
584-
url=self._build_url('contents',path,base_url=self._api)
585-
json=self._json(self._get(url,params={'ref':ref}),200)
586-
ifisinstance(json,dict):
587-
returnContents(json,self)
588-
elifisinstance(json,list):
589-
returndict((j.get('name'),Contents(j,self))forjinjson)
590-
returnNone
591-
592566
defcontributor_statistics(self,number=-1,etag=None):
593567
"""Iterate over the contributors list.
594568

‎tests/test_repos.py‎

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -116,31 +116,6 @@ def test_compare_commits(self):
116116
repos.comparison.Comparison)
117117
self.mock_assertions()
118118

119-
deftest_contents(self):
120-
self.response('contents')
121-
filename='setup.py'
122-
self.get(self.api+'contents/'+filename)
123-
124-
assertisinstance(self.repo.contents(filename),
125-
repos.contents.Contents)
126-
self.mock_assertions()
127-
128-
self.response('contents',_iter=True)
129-
files=self.repo.contents(filename)
130-
assertisinstance(files,dict)
131-
132-
self.mock_assertions()
133-
134-
deftest_contents_ref(self):
135-
self.response('contents')
136-
filename='setup.py'
137-
self.get(self.api+'contents/'+filename)
138-
self.conf= {'params': {'ref':'foo'}}
139-
140-
assertisinstance(self.repo.contents(filename,ref='foo'),
141-
repos.contents.Contents)
142-
self.mock_assertions()
143-
144119
deftest_create_blob(self):
145120
self.response('blob',201)
146121
content='VGVzdCBibG9i\n'

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp