[TIP] Supplying variable options to unittest2 tests

Ron Harding rharding64 at yahoo.com
Wed Jun 22 11:50:37 PDT 2016


hello  Perry, 
i am EE and software guy in C,c++, c# and now python where i have developed test frameworks myself and used frameworks made by others as well.    tools i have developed are used to program, configure and test various devices, modules and prototypes at all stages of new electronic device development. on feeding variables, you need to follow OOP design practices by creating new classes containing public get/set accessors; i.e. if the hardware interface is LAN, you could build in a class with an overloaded constructor with overloads as follows;class Tcp:     Tcp():     //use declared default ip address and port       ...     Tcp(ipAddress):     //use default port and new ipaddress     ...     Tcp(ipAddress, Port):      //use new ipaddress and port

does this give you ideas Perry?
Ron      ...“The desire that guides me in all I do is the desire to harness the forces of nature to the service of mankind. ”Nikola Tesla“Radio Power Will Revolutionize the World” (Modern Mechanix & Inventions, July, 1934) 

    On Wednesday, June 22, 2016 8:11 AM, Perry Johnson <Perry.Johnson at efi.com> wrote:
 

  <!--#yiv3876613765 _filtered #yiv3876613765 {font-family:"Cambria Math";panose-1:2 4 5 3 5 4 6 3 2 4;} _filtered #yiv3876613765 {font-family:Calibri;panose-1:2 15 5 2 2 2 4 3 2 4;}#yiv3876613765 #yiv3876613765 p.yiv3876613765MsoNormal, #yiv3876613765 li.yiv3876613765MsoNormal, #yiv3876613765 div.yiv3876613765MsoNormal {margin:0in;margin-bottom:.0001pt;font-size:11.0pt;font-family:"Calibri", "sans-serif";}#yiv3876613765 a:link, #yiv3876613765 span.yiv3876613765MsoHyperlink {color:blue;text-decoration:underline;}#yiv3876613765 a:visited, #yiv3876613765 span.yiv3876613765MsoHyperlinkFollowed {color:purple;text-decoration:underline;}#yiv3876613765 span.yiv3876613765EmailStyle17 {font-family:"Calibri", "sans-serif";color:windowtext;}#yiv3876613765 .yiv3876613765MsoChpDefault {} _filtered #yiv3876613765 {margin:1.0in 1.0in 1.0in 1.0in;}#yiv3876613765 div.yiv3876613765WordSection1 {}-->Hi all,    I hope this is the right mailing list for this type of question, but I am trying to work with unittest to run through test cases, and I am just not understanding how to do what I need to do.  Knowledge wise I am a step up from beginner at Python, and I am without a formal CS degree.  If I should go to another list, please, let me know which one, and accept my apologies.    Here is the set up.      I have a list of settings for software on a physical device which are test cases from a test case management application.  These cases involve setting options on the device through software, running a test, and checking the device's output.  I have set up a basic script to do the options setting, running, and checking.  I also have a framework supplied to me using unittest2 that will generate an html file with results of test cases run, using the unittest2.TestCase class.    I would like to get each "test case" from the TCM application, run those settings through my script, and then get the results from the existing framework.  The trouble is I don't see a way to feed variable options into the unittest2.TestCase, and from what I have read this may not be what the module was designed for.  Creating individual test_ methods for every set of test case options is unwieldy because the options change, and there are thousands of tests.    Is there an easy way to work around this, or would it be easier to scrap the supplied framework and use another module set for testing?  My boss would like me to use the existing framework, but if it isn't too much trouble I could probably build my own in my off hours.    Thank you for reading.    Best Regards, Perry Johnson    
Confidentiality notice: This message may contain confidential information. It is intended only for the person to whom it is addressed. If you are not that person, you should not use this message. We request that you notify us by replying to this message, and then delete all copies including any contained in your reply. Thank you.

_______________________________________________
testing-in-python mailing list
testing-in-python at lists.idyll.org
http://lists.idyll.org/listinfo/testing-in-python


  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.idyll.org/pipermail/testing-in-python/attachments/20160622/d227c532/attachment.htm>


More information about the testing-in-python mailing list