mirror of
https://github.com/status-im/PyGithub.git
synced 2026-09-01 03:11:09 +00:00
Hook testing
This commit is contained in:
+1
-2
@@ -383,8 +383,7 @@ class IntegrationTest:
|
||||
|
||||
sameHook = r.get_hook( h.id )
|
||||
|
||||
### @todo Uncomment when API `/repos/:user/:repo/hooks/:id/test` is implemented
|
||||
# h.test()
|
||||
h.test()
|
||||
|
||||
h.delete()
|
||||
self.printList( "Hooks", r.get_hooks(), lambda h: h.name + str( h.config ) )
|
||||
|
||||
+18
-5
@@ -302,10 +302,10 @@ Attributes
|
||||
* `sha`
|
||||
* `url`
|
||||
* `message`
|
||||
* `parents`
|
||||
* `author`
|
||||
* `committer`
|
||||
* `tree`
|
||||
* `parents`
|
||||
* `tree`: `GitTree`
|
||||
|
||||
Class `GitRef`
|
||||
==============
|
||||
@@ -346,15 +346,28 @@ Class `Hook`
|
||||
|
||||
Attributes
|
||||
----------
|
||||
* `url`
|
||||
* `updated_at`
|
||||
* `created_at`
|
||||
* `name`
|
||||
* `events`
|
||||
* `active`
|
||||
* `config`
|
||||
* `id`
|
||||
* `last_response`
|
||||
|
||||
Modification
|
||||
------------
|
||||
* `edit()`
|
||||
* `edit( name, config, [events, add_events, remove_events, active] )`
|
||||
|
||||
Deletion
|
||||
--------
|
||||
* `delete()`
|
||||
|
||||
Testing
|
||||
-------
|
||||
* `test()`
|
||||
|
||||
Class `Issue`
|
||||
=============
|
||||
|
||||
@@ -728,7 +741,7 @@ Hooks
|
||||
-----
|
||||
* `get_hooks()`: list of `Hook`
|
||||
* `get_hook( id )`: `Hook`
|
||||
* `create_hook()`: `Hook`
|
||||
* `create_hook( name, config, [events, active] )`: `Hook`
|
||||
|
||||
Keys
|
||||
----
|
||||
@@ -912,7 +925,7 @@ Attributes
|
||||
|
||||
Modification
|
||||
------------
|
||||
* `edit( title, key )`
|
||||
* `edit( [title, key] )`
|
||||
|
||||
Deletion
|
||||
--------
|
||||
|
||||
@@ -3,6 +3,8 @@ import urllib
|
||||
|
||||
from GithubObject import *
|
||||
|
||||
def __testHook( hook ):
|
||||
hook._github._statusRequest( "POST", hook._baseUrl + "/test", None, None )
|
||||
Hook = GithubObject(
|
||||
"Hook",
|
||||
BaseUrl( lambda obj: obj._repo._baseUrl + "/hooks/" + str( obj.id ) ),
|
||||
@@ -13,6 +15,7 @@ Hook = GithubObject(
|
||||
),
|
||||
Editable( [ "name", "config" ], [ "events", "add_events", "remove_events", "active" ] ),
|
||||
Deletable(),
|
||||
SeveralAttributePolicies( [ MethodFromCallable( "test", [], [], __testHook, SimpleTypePolicy( None ) ) ], "Testing" )
|
||||
)
|
||||
|
||||
Authorization = GithubObject(
|
||||
|
||||
Reference in New Issue
Block a user