I am fairly new to programming and I am trying to learn the python Nose module for testing a code (myscript.py) that takes 2 input files and writes 2 output files. I want to write a test.py script (to run using Nose) that will take a bunch of test files, run them as input files, and then evaluate the output files by comparing them to known output. I understand that it is better to test functions individually, but my questions are applicable to either scenario.
Here is my confusion. How do I specify that test.py is supposed to run on myscript.py? Does test.py need to actually open up myscript.py? If so, I presume I would "import myscript.py"? Could/should I actually generate input/output files during testing, or should I use something like StringIO?
Better to create a functions which accept text as an argument and return text as well. These functions should be placed in the myscript.py and tested in the tests.py.
Basics of Using Python Nose