jeudi 7 janvier 2016

Python test whole script

I have a python script. I use unittest for tests, but how can I test whole script. My idea is something like this:

 def test_script(self):
     output=runScript('test.py --a 5 --b 3')
     self.assertEqual(output, '8') 

test.py takes argument a and b and print a+b in this case 8

Aucun commentaire:

Enregistrer un commentaire