File: //usr/lib/python3/dist-packages/twisted/trial/test/__pycache__/mockdoctest.cpython-38.pyc
U
W[U
� @ s$ d dl mZmZ G dd� de�ZdS )� )�division�absolute_importc @ sN e Zd ZdZdZddd�Zdd� Zdd � Zd
d� Zdd
� Z dd� Z
dd� ZdS )�Countera9 a 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
r Nc C s || _ || _d S )N)�_count�maxval)�selfZinitialValuer � r �@/usr/lib/python3/dist-packages/twisted/trial/test/mockdoctest.py�__init__ s zCounter.__init__c C s6 | j dk r$| j| | j kr$td��n| j|7 _| S )z�add other to my value and return self
>>> c = Counter(100)
>>> c += 333
>>> c == 433
True
Nzsorry, counter got too big)r r �
ValueError�r �otherr r r �__iadd__ s
zCounter.__iadd__c C s
| j |kS )z�equality 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 r r r �__eq__. s zCounter.__eq__c C s | � |� S )zginequality operator
>>> c = Counter()
>>> c != 10
True
)r r r r r �__ne__<