Source code for pook.interceptors.base

from abc import abstractmethod, ABCMeta


[docs] class BaseInterceptor(object): """ BaseInterceptor provides a base class for HTTP traffic interceptors implementations. """ __metaclass__ = ABCMeta def __init__(self, engine): self.patchers = [] self.engine = engine @property def name(self): """ Exposes the interceptor class name. """ return type(self).__name__
[docs] @abstractmethod def activate(self): """ Activates the traffic interceptor. This method must be implemented by any interceptor. """ pass
[docs] @abstractmethod def disable(self): """ Disables the traffic interceptor. This method must be implemented by any interceptor. """ pass