fail2ban.server.mytime module
*****************************

class fail2ban.server.mytime.MyTime

   Bases: "object"

   A wrapper around time module primarily for testing purposes

   This class is a wrapper around time.time()  and time.gmtime(). When
   performing unit test, it is very useful to get a fixed value from
   these functions.  Thus, time.time() and time.gmtime() should never
   be called directly.  This wrapper should be called instead. The API
   are equivalent.

   Attributes:
      **myTime**
   -[ Methods ]-

   +------------+--------------------------------------------------------------------------------------------+
   | "gmtime"() | Decorate time.gmtime() for the purpose of testing mocking                                  |
   +------------+--------------------------------------------------------------------------------------------+
   | "localtim  | Decorate time.localtime() for the purpose of testing mocking                               |
   | e"([x])    |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+
   | "now"()    | Decorate datetime.now() for the purpose of testing mocking                                 |
   +------------+--------------------------------------------------------------------------------------------+
   | "setTime"  | Set current time.                                                                          |
   | (t)        |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+
   | "time"()   | Decorate time.time() for the purpose of testing mocking                                    |
   +------------+--------------------------------------------------------------------------------------------+

   static gmtime()

      Decorate time.gmtime() for the purpose of testing mocking

      @return time.gmtime() if setTime was called with None

   static localtime(x=None)

      Decorate time.localtime() for the purpose of testing mocking

      @return time.localtime() if setTime was called with None

   myTime = None

   static now()

      Decorate datetime.now() for the purpose of testing mocking

      @return datetime.now() if setTime was called with None

   static setTime(t)

      Set current time.

      Use None in order to always get the real current time.

      @param t the time to set or None

   static time()

      Decorate time.time() for the purpose of testing mocking

      @return time.time() if setTime was called with None
