{"action":"created","issue":{"url":"https://api.github.com/repos/svanoort/pyresttest/issues/12","labels_url":"https://api.github.com/repos/svanoort/pyresttest/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/svanoort/pyresttest/issues/12/comments","events_url":"https://api.github.com/repos/svanoort/pyresttest/issues/12/events","html_url":"https://github.com/svanoort/pyresttest/issues/12","id":50307119,"number":12,"title":"Extension register functions: validate appropriate function args","user":{"login":"svanoort","id":5400948,"avatar_url":"https://avatars.githubusercontent.com/u/5400948?v=3","gravatar_id":"","url":"https://api.github.com/users/svanoort","html_url":"https://github.com/svanoort","followers_url":"https://api.github.com/users/svanoort/followers","following_url":"https://api.github.com/users/svanoort/following{/other_user}","gists_url":"https://api.github.com/users/svanoort/gists{/gist_id}","starred_url":"https://api.github.com/users/svanoort/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svanoort/subscriptions","organizations_url":"https://api.github.com/users/svanoort/orgs","repos_url":"https://api.github.com/users/svanoort/repos","events_url":"https://api.github.com/users/svanoort/events{/privacy}","received_events_url":"https://api.github.com/users/svanoort/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/svanoort/pyresttest/labels/enhancement","name":"enhancement","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/svanoort/pyresttest/milestones/6","html_url":"https://github.com/svanoort/pyresttest/milestones/Maybe%20Whenever","labels_url":"https://api.github.com/repos/svanoort/pyresttest/milestones/6/labels","id":1331457,"number":6,"title":"Maybe Whenever","description":"Low-priority items, nice-to-have issues... drop a comment on the issue if this is something you find useful for your use case and it will be bumped up.","creator":{"login":"svanoort","id":5400948,"avatar_url":"https://avatars.githubusercontent.com/u/5400948?v=3","gravatar_id":"","url":"https://api.github.com/users/svanoort","html_url":"https://github.com/svanoort","followers_url":"https://api.github.com/users/svanoort/followers","following_url":"https://api.github.com/users/svanoort/following{/other_user}","gists_url":"https://api.github.com/users/svanoort/gists{/gist_id}","starred_url":"https://api.github.com/users/svanoort/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svanoort/subscriptions","organizations_url":"https://api.github.com/users/svanoort/orgs","repos_url":"https://api.github.com/users/svanoort/repos","events_url":"https://api.github.com/users/svanoort/events{/privacy}","received_events_url":"https://api.github.com/users/svanoort/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":0,"state":"open","created_at":"2015-09-30T16:03:47Z","updated_at":"2015-11-02T13:26:42Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2014-11-27T16:20:33Z","updated_at":"2015-11-18T20:17:01Z","closed_at":null,"body":"As a developer, I want to check the arguments of supplied functions when registering extension  matches what I'd expect.  (IE a comparator takes 2 args, etc)\r\n\r\nSee: http://stackoverflow.com/questions/847936/how-can-i-find-the-number-of-arguments-of-a-python-function"},"comment":{"url":"https://api.github.com/repos/svanoort/pyresttest/issues/comments/157849796","html_url":"https://github.com/svanoort/pyresttest/issues/12#issuecomment-157849796","issue_url":"https://api.github.com/repos/svanoort/pyresttest/issues/12","id":157849796,"user":{"login":"svanoort","id":5400948,"avatar_url":"https://avatars.githubusercontent.com/u/5400948?v=3","gravatar_id":"","url":"https://api.github.com/users/svanoort","html_url":"https://github.com/svanoort","followers_url":"https://api.github.com/users/svanoort/followers","following_url":"https://api.github.com/users/svanoort/following{/other_user}","gists_url":"https://api.github.com/users/svanoort/gists{/gist_id}","starred_url":"https://api.github.com/users/svanoort/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svanoort/subscriptions","organizations_url":"https://api.github.com/users/svanoort/orgs","repos_url":"https://api.github.com/users/svanoort/repos","events_url":"https://api.github.com/users/svanoort/events{/privacy}","received_events_url":"https://api.github.com/users/svanoort/received_events","type":"User","site_admin":false},"created_at":"2015-11-18T20:17:01Z","updated_at":"2015-11-18T20:17:01Z","body":"@ram-peri  In response to your questions:\r\n\r\n1. No, each one of the extension points has its own register function listed here:  https://github.com/svanoort/pyresttest/blob/master/pyresttest/resttest.py#L713-L718\r\n\r\nThe checks on the argument types should be performed within register method, since it will be different for each extension type (generator, validator, test, comparator, etc).  To be honest, we're really only validating the parse function provided to instantiate an instance of that extension.  These should raise an Exception if the method signature for the parse function is invalid.\r\n\r\nThe main register_extension method in resttest.py needs to log exceptions if extension parsing methods are not valid, but still be able to continue in the event that one extension fails to load.\r\n\r\n2. No, there's no reason to protect it."}}