Excellent , your example is elegant and runs beautifully
so the idea is to create a testcase which runs a general function
"testRun" (which calls the function defined in file )and loads data
based on type ,
add this testcase to suite and run suite.
thanks , this is exactly what I was looking for
> thanks for any input or any alternate approach to it
I think that your approach is not fair.
You should create a TestCase for each of your data input, add it to a TestSuite
and run the test suite.
Here is a stub for loading just a 'dict' type, hoping it is helpful
import unittest
import glob
Thanks for reply, here is the script with trucated datafile
The data file is following ,
--- data file
getUSStates~~dict~
{AK: Alaska,
AL: Alabama,
AR: Arkansas,
AZ: Arizona,
CA: California,
CO: Colorado,
WY: Wyoming }
data file
I want to test function:ge
Sakcee wrote:
> Hi
>
> I am trying to use pyUnit to create a framework for testing functions
>
> I am reading function name, expected output, from a text file.
Can you show a sample of what the text file might look like, and what tests you
want to
generate from it?
> and in python generating
Please anyone help, is this kind of dynamin thing possible? any
suggestion for creating frameworks for automated testing ,
all comments appreciated
thanks
Sakcee wrote:
> Hi
>
> I am trying to use pyUnit to create a framework for testing functions
>
> I am reading function name, expected outpu
Hi
I am trying to use pyUnit to create a framework for testing functions
I am reading function name, expected output, from a text file.
and in python generating dynamic test functions
something like this
class getUsStatesTest( unittest.TestCase ):
self.setUp = lambda : function_call