/usr/lib/python3/dist-packages/twisted/trial/test/__pycache__
Edit: /usr/lib/python3/dist-packages/twisted/trial/test/__pycache__/mockdoctest.cpython-310.pyc (2899B)
o
¯bu ã @ s G d d„ dƒZ dS )c @ sb e Zd ZdZdZddd„Zdd„ Zded efd
d„Z ded efdd
„Z
dd„ Zdd„ Zdd„ Z
dS )ÚCounterzø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
é Nc C s || _ || _d S )N)Ú_countÚmaxval)ÚselfÚinitialValuer © r ú@/usr/lib/python3/dist-packages/twisted/trial/test/mockdoctest.pyÚ__init__ s
zCounter.__init__c C s4 | j dur| j| | j krtdƒ‚| 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__r Úreturnc 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 )zXinequality operator
>>> c = Counter()
>>> c != 10
True
)r r r r r Ú__ne__= s zCounter.__ne__c C s | d¡ dS )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 "
", 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 r r r ÚincrF s zCounter.incrc C s | j S )zlreturn this counter's value
>>> c = Counter(555)
>>> c.value() == 555
True
r r r r r ÚvalueY s z
Counter.valuec C s dS )zui will raise an unexpected exception...
... *CAUSE THAT'S THE KINDA GUY I AM*
>>> 1/0
Nr r r r r ÚunexpectedExceptionb s zCounter.unexpectedException)r N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r r r
ÚobjectÚboolr r r r r r r r r r s
r N)r r r r r Ú s