David N Montgomery a écrit :
> class testCase:
> def __init__(self, tc):
> if tc == 1:self.testCase1()
> if tc == 2:self.testCase2()
> if tc == 3:self.testCase3()
> if tc == 4:self.testCase4()
> if tc == 5:self.testCase5()
> if tc == 6:self.testCa
On Aug 22, 4:52 am, "David N Montgomery" <[EMAIL PROTECTED]>
wrote:
> unittest is the best choice for my needs and works perfectly in Eclipse.
> Unfortunately though it (and many other things) does not work under the
> application we have to use to run our python scripts.
>
> This leaves me with 'f
On Wed, 22 Aug 2007 02:39:45 -, "Basilisk96" <[EMAIL PROTECTED]>
said:
> David,
>
> If your true design intent is to run X number of test cases, unittest
> is the biggest bang for your buck, like shown by Peter's example. You
> just subclass unittest.TestCase, and def your test methods in the
David,
If your true design intent is to run X number of test cases, unittest
is the biggest bang for your buck, like shown by Peter's example. You
just subclass unittest.TestCase, and def your test methods in the
class body; they will simply be executed in the order you list them.
It's just nice h
On Tue, 21 Aug 2007 21:56:18 +0200, Hrvoje Niksic <[EMAIL PROTECTED]>
wrote:
>Christof Winter <[EMAIL PROTECTED]> writes:
>
>> To get rid of the if statements, replace __init__ function with:
>>
>> def __init__(self, tc):
>> functionToCall = eval("self.testCase%s" % tc)
>
>Or functio
Christof Winter <[EMAIL PROTECTED]> writes:
> To get rid of the if statements, replace __init__ function with:
>
> def __init__(self, tc):
> functionToCall = eval("self.testCase%s" % tc)
Or functionToCall = getattr(self, "testCase" + tc)
eval can introduce unwanted side effects.
--
David N Montgomery wrote:
> class testCase:
> def __init__(self, tc):
> if tc == 1:self.testCase1()
> if tc == 2:self.testCase2()
> if tc == 3:self.testCase3()
> if tc == 4:self.testCase4()
> if tc == 5:self.testCase5()
> if tc == 6:self.testCase6
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
David N Montgomery schrieb:
> class testCase:
> def __init__(self, tc):
> if tc == 1:self.testCase1()
> if tc == 2:self.testCase2()
> if tc == 3:self.testCase3()
> if tc == 4:self.testCase4()
> if tc == 5:sel
On Aug 21, 11:20 am, "J. Cliff Dyer" <[EMAIL PROTECTED]> wrote:
> I suspect lambda might be your friend here too for making the code less
> verbose, though I never really got the hang of lambdas, even though my
> first programming experience was a scheme class way back when Ah well.
That's be
David N Montgomery wrote:
> class testCase:
> def __init__(self, tc):
> if tc == 1:self.testCase1()
> if tc == 2:self.testCase2()
> if tc == 3:self.testCase3()
> if tc == 4:self.testCase4()
> if tc == 5:self.testCase5()
> if tc == 6:self.testCase6
David N Montgomery wrote:
> class testCase:
> def __init__(self, tc):
> if tc == 1:self.testCase1()
> if tc == 2:self.testCase2()
> if tc == 3:self.testCase3()
> if tc == 4:self.testCase4()
> if tc == 5:self.testCase5()
> if tc == 6:self.testCase
On Aug 21, 10:59 am, "David N Montgomery" <[EMAIL PROTECTED]>
wrote:
> class testCase:
> def __init__(self, tc):
> if tc == 1:self.testCase1()
> if tc == 2:self.testCase2()
> if tc == 3:self.testCase3()
> if tc == 4:self.testCase4()
> if tc == 5:self.test
class testCase:
def __init__(self, tc):
if tc == 1:self.testCase1()
if tc == 2:self.testCase2()
if tc == 3:self.testCase3()
if tc == 4:self.testCase4()
if tc == 5:self.testCase5()
if tc == 6:self.testCase6()
def testCase1(self):
print
13 matches
Mail list logo