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

Commit6e37d74

Browse files
committed
Fix potential bug in Hook.edit
Add more rigorous tests for Hook.edit.
1 parent5a36bb0 commit6e37d74

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

‎github3/repos.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1830,7 +1830,7 @@ def edit(self, name, config, events=[], add_events=[], rm_events=[],
18301830
for
18311831
:type events: list
18321832
:param add_events: (optional), events to be added to the list of
1833-
events that this hook triggers for
1833+
events that this hook triggers for
18341834
:type add_events: list
18351835
:param rm_events: (optional), events to be remvoed from the list
18361836
of events that this hook triggers for
@@ -1839,6 +1839,7 @@ def edit(self, name, config, events=[], add_events=[], rm_events=[],
18391839
:type active: bool
18401840
:returns: bool
18411841
"""
1842+
json=None
18421843
ifnameandconfigandisinstance(config,dict):
18431844
data= {'name':name,'config':config,'active':active}
18441845
ifevents:

‎tests/test_repos.py‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -838,10 +838,14 @@ def test_edit(self):
838838
ifnotself.auth:
839839
self.raisesGHE(self.hook.edit,'tweeter',self.hook.config)
840840
else:
841+
expect(self.hook.edit('', {})).is_False()
841842
expect(self.hook.edit(self.hook.name,self.hook.config,
842-
notself.hook._active)).is_True()
843+
active=notself.hook._active)).is_True()
843844
expect(self.hook.edit(self.hook.name,self.hook.config,
844-
notself.hook._active)).is_True()
845+
active=notself.hook._active)).is_True()
846+
expect(self.hook.edit(self.hook.name,self.hook.config,
847+
['push'], ['gollum','issues'],
848+
['gollum','issuues'])).is_True()
845849

846850
deftest_test(self):
847851
ifnotself.auth:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp