On 6 Jan 2006 07:57:04 -0800, KraftDiner <[EMAIL PROTECTED]> wrote:
>try this:
>
>class x(object):
>   def __init__(self):
>      self.someName = "hello"
>   def someMethod(self):
>      self.sumName = "bye"
>
>find that bug.
>

[EMAIL PROTECTED]:~$ cat > xobj.py
class x(object):
        def __init__(self):    
                self.someName = "hello"
        def someMethod(self):
                self.sumName = "bye"
[EMAIL PROTECTED]:~$ cat > test_xobj.py
from twisted.trial import unittest

import xobj

class XObjTestCase(unittest.TestCase):
        def testSomeName(self):
                x = xobj.x()
                self.assertEquals(x.someName, "hello")
                x.someMethod()
                self.assertEquals(x.someName, "bye")
[EMAIL PROTECTED]:~$ trial test_xobj.py 
Running 1 tests.
test_xobj
  XObjTestCase
    testSomeName ...                                       [FAIL]

=================================================================
[FAIL]: test_xobj.XObjTestCase.testSomeName

  File "/home/exarkun/test_xobj.py", line 10, in testSomeName
    self.assertEquals(x.someName, "bye")
twisted.trial.unittest.FailTest: 'hello' != 'bye'
-----------------------------------------------------------------
Ran 1 tests in 0.278s

FAILED (failures=1)
[EMAIL PROTECTED]:~$ 

Hope this helps,

Jean-Paul
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to