Current Path : /usr/lib/python2.7/dist-packages/twisted/trial/test/ |
Current File : //usr/lib/python2.7/dist-packages/twisted/trial/test/mockdoctest.pyc |
[XMc @ s d e f d YZ d S( t Counterc B sY e Z d Z d Z d d d Z d Z d Z d Z d Z d Z d Z RS( s9 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 i c C s | | _ | | _ d S( N( t _countt maxval( t selft initialValueR ( ( sB /usr/lib/python2.7/dist-packages/twisted/trial/test/mockdoctest.pyt __init__ s c C sD | j d k r1 | j | | j k r1 t d n | j | 7_ | S( s add other to my value and return self >>> c = Counter(100) >>> c += 333 >>> c == 433 True s sorry, counter got too bigN( R t NoneR t ValueError( R t other( ( sB /usr/lib/python2.7/dist-packages/twisted/trial/test/mockdoctest.pyt __iadd__ s %c C s | j | k S( s 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 ( ( sB /usr/lib/python2.7/dist-packages/twisted/trial/test/mockdoctest.pyt __eq__. s c C s | j | S( sg inequality operator >>> c = Counter() >>> c != 10 True ( R ( R R ( ( sB /usr/lib/python2.7/dist-packages/twisted/trial/test/mockdoctest.pyt __ne__<