
    tfu	                           G d  d          Z dS )c                   V    e Zd ZdZdZddZd ZdedefdZ	dedefd	Z
d
 Zd Zd ZdS )Counterza simple counter object for testing trial's doctest support

    >>> c = Counter()
    >>> c.value()
    0
    >>> c += 3
    >>> c.value()
    3
    >>> c.incr()
    >>> c.value() == 4
    True
    >>> c == 4
    True
    >>> c != 9
    True

        Nc                 "    || _         || _        d S )N)_countmaxval)selfinitialValuer   s      ]/var/www/surfInsights/venv3-11/lib/python3.11/site-packages/twisted/trial/test/mockdoctest.py__init__zCounter.__init__   s    "    c                 x    | j         "| j        |z   | j         k    rt          d          | xj        |z  c_        | S )zadd other to my value and return self

        >>> c = Counter(100)
        >>> c += 333
        >>> c == 433
        True
        Nzsorry, counter got too big)r   r   
ValueErrorr   others     r
   __iadd__zCounter.__iadd__!   sC     ;"u)<(K(K9:::KK5 KKr   r   returnc                     | j         |k    S )zequality operator, compare other to my value()

        >>> c = Counter()
        >>> c == 0
        True
        >>> c += 10
        >>> c.incr()
        >>> c == 10   # fail this test on purpose
        True

        r   r   s     r
   __eq__zCounter.__eq__/   s     {e##r   c                 .    |                      |           S )zXinequality operator

        >>> c = Counter()
        >>> c != 10
        True
        )r   r   s     r
   __ne__zCounter.__ne__=   s     ;;u%%%%r   c                 0    |                      d           dS )a:  increment my value by 1

        >>> from twisted.trial.test.mockdoctest import Counter
        >>> c = Counter(10, 11)
        >>> c.incr()
        >>> c.value() == 11
        True
        >>> c.incr()
        Traceback (most recent call last):
          File "<stdin>", line 1, in ?
          File "twisted/trial/test/mockdoctest.py", line 51, in incr
            self.__iadd__(1)
          File "twisted/trial/test/mockdoctest.py", line 39, in __iadd__
            raise ValueError, "sorry, counter got too big"
        ValueError: sorry, counter got too big
           N)r   r   s    r
   incrzCounter.incrF   s    " 	ar   c                     | j         S )zlreturn this counter's value

        >>> c = Counter(555)
        >>> c.value() == 555
        True
        r   r   s    r
   valuezCounter.valueY   s     {r   c                     dS )zui will raise an unexpected exception...
        ... *CAUSE THAT'S THE KINDA GUY I AM*

              >>> 1/0
        N r   s    r
   unexpectedExceptionzCounter.unexpectedExceptionb   s      r   )r   N)__name__
__module____qualname____doc__r   r   r   objectboolr   r   r   r   r    r   r   r
   r   r      s         $ F     $F $t $ $ $ $&F &t & & & &  &      r   r   N)r   r   r   r
   <module>r'      sA   _ _ _ _ _ _ _ _ _ _r   