mirror of
https://github.com/status-im/PyGithub.git
synced 2026-08-31 19:01:15 +00:00
Add debug / test mechanism
This commit is contained in:
@@ -39,6 +39,12 @@ class GithubObject(object):
|
||||
"""
|
||||
Base class for all classes representing objects returned by the API.
|
||||
"""
|
||||
|
||||
'''
|
||||
A global debug flag to enable header validation by requester for all objects
|
||||
'''
|
||||
CHECK_AFTER_INIT_FLAG = False
|
||||
|
||||
def __init__(self, requester, headers, attributes, completed):
|
||||
self._requester = requester
|
||||
# Make sure headers are signed before any operations on attributes
|
||||
@@ -47,6 +53,11 @@ class GithubObject(object):
|
||||
self._initAttributes()
|
||||
self._storeAndUseAttributes(attributes)
|
||||
|
||||
# Ask requester to do some checking, for debug and test purpose
|
||||
# Since it's most handy to access and kinda all-knowing
|
||||
if (GithubObject.CHECK_AFTER_INIT_FLAG):
|
||||
requester.check_me(self);
|
||||
|
||||
def _storeAndUseAttributes(self, attributes):
|
||||
self._useAttributes(attributes)
|
||||
self._rawData = attributes
|
||||
|
||||
Reference in New Issue
Block a user