Hook testing

This commit is contained in:
Vincent Jacques
2012-03-04 09:46:19 +00:00
parent f03d86c46e
commit 00a832e6d5
3 changed files with 22 additions and 7 deletions
+1 -2
View File
@@ -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
View File
@@ -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
View File
@@ -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(