Your IP : 172.28.240.42


Current Path : /usr/lib/python2.7/dist-packages/twisted/trial/test/
Upload File :
Current File : //usr/lib/python2.7/dist-packages/twisted/trial/test/mockdoctest.pyc


[XMc@sdefdYZdS(tCountercBsYeZdZdZdd	dZdZdZdZdZ	dZ
dZRS(
s9a 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

    icCs||_||_dS(N(t_counttmaxval(tselftinitialValueR((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/mockdoctest.pyt__init__s	cCsD|jdk	r1|j||jkr1tdn|j|7_|S(sadd other to my value and return self

             >>> c = Counter(100)
             >>> c += 333
             >>> c == 433
             True
        ssorry, counter got too bigN(RtNoneRt
ValueError(Rtother((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/mockdoctest.pyt__iadd__ s%cCs
|j|kS(sequality operator, compare other to my value()
           
           >>> c = Counter()
           >>> c == 0
           True
           >>> c += 10
           >>> c.incr()
           >>> c == 10   # fail this test on purpose
           True

        (R(RR((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/mockdoctest.pyt__eq__.scCs|j|S(sginequality operator

             >>> c = Counter()
             >>> c != 10
             True
        (R
(RR((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/mockdoctest.pyt__ne__<scCs|jddS(s{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
        iN(R	(R((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/mockdoctest.pytincrEscCs|jS(s{return this counter's value

             >>> c = Counter(555)
             >>> c.value() == 555
             True
        (R(R((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/mockdoctest.pytvalueXscCsdS(si will raise an unexpected exception...
        ... *CAUSE THAT'S THE KINDA GUY I AM*
            
              >>> 1/0
        N((R((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/mockdoctest.pytunexpectedExceptionasN(t__name__t
__module__t__doc__RRRR	R
RRR
R(((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/mockdoctest.pyRs							N(tobjectR(((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/mockdoctest.pyt<module>s