Re: unittest help needed!

2010-01-14 Thread Phlip
Oltmans wrote: def test_first(self): print 'first test' process(123) All test cases use the pattern "Assemble Activate Assert". You are assembling a 123, and activating process(), but where is your assert? If it is inside process() (if process is a test-side method), then

Re: unittest help needed!

2010-01-14 Thread Oltmans
On Jan 14, 11:46 pm, exar...@twistedmatrix.com wrote: > When you run test.py, it gets to the loadTestsFromName line.  There, it > imports the module named "test" in order to load tests from it.  To > import > that module, it runs test.py again.  By the time it finishes running the > contents of t

Re: unittest help needed!

2010-01-14 Thread exarkun
On 06:33 pm, rolf.oltm...@gmail.com wrote: Hi Python gurus, I'm quite new to Python and have a problem. Following code resides in a file named test.py --- import unittest class result(unittest.TestResult): pass class tee(unittest.TestCase): def test_first(self): print 'first te

unittest help needed!

2010-01-14 Thread Oltmans
Hi Python gurus, I'm quite new to Python and have a problem. Following code resides in a file named test.py --- import unittest class result(unittest.TestResult): pass class tee(unittest.TestCase): def test_first(self): print 'first test' print '-' def

Re: unittest help

2005-03-24 Thread Scott David Daniels
Duncan Booth wrote: Qiangning Hong wrote: As you see, it is an OO wrapper on _extmod, which is a pyrex extension module. The question is: how to unittest this class? As the _extmod is hardware-dependent, I want to use a mock class to replace it in unit test. But how can I let myclass in unittes

Re: unittest help

2005-03-24 Thread Duncan Booth
Qiangning Hong wrote: > As you see, it is an OO wrapper on _extmod, which is a pyrex extension > module. The question is: how to unittest this class? As the _extmod > is hardware-dependent, I want to use a mock class to replace it in unit > test. But how can I let myclass in unittest to import

Re: unittest help

2005-03-24 Thread André Malo
* "Qiangning Hong" <[EMAIL PROTECTED]> wrote: > I want to apply TDD (test driven development) on my project. I am > working on a class like this (in plan): > > # file: myclass.py > import _extmod > > class MyClass(object): > def __init__(self): > self.handle = _extmod.open() > >

unittest help

2005-03-24 Thread Qiangning Hong
I want to apply TDD (test driven development) on my project. I am working on a class like this (in plan): # file: myclass.py import _extmod class MyClass(object): def __init__(self): self.handle = _extmod.open() def __del__(self): _extmod.close(self.handle) def some