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

Commit827b45a

Browse files
committed
Add unit tests around github3.repos.release.Asset
1 parentf26b262 commit827b45a

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

‎github3/repos/release.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ def upload_asset(self, content_type, name, asset):
135135
classAsset(GitHubCore):
136136
def__init__(self,asset,session=None):
137137
super(Asset,self).__init__(asset,session)
138+
self._api=asset.get('url')
138139
#: Content-Type provided when the asset was created
139140
self.content_type=asset.get('content_type')
140141
#: Date the asset was created

‎tests/unit/test_repos_release.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,19 @@ class TestAsset(UnitHelper):
5353
"created_at":"2013-02-27T19:35:32Z",
5454
"updated_at":"2013-02-27T19:35:32Z"
5555
}
56+
57+
deftest_edit_without_label(self):
58+
self.instance.edit('new name')
59+
self.session.patch.assert_called_once_with(
60+
self.example_data['url'],
61+
data={'name':'new name'},
62+
headers={'Accept':'application/vnd.github.manifold-preview'}
63+
)
64+
65+
deftest_edit_with_label(self):
66+
self.instance.edit('new name','label')
67+
self.session.patch.assert_called_once_with(
68+
self.example_data['url'],
69+
data={'name':'new name','label':'label'},
70+
headers={'Accept':'application/vnd.github.manifold-preview'}
71+
)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp