mercredi 2 décembre 2015

How can I run a python unittest where I need to tell the test where a file is?

I am trying to write a Python unittest for a method that does some processing on a file. This is a large'ish binary file, so I don't want to recreate a temporary version of it in the setUp() method.

Is there a best practices for writing a unittest for a scenario like this?

  • Would I pass in a file path as an argument?
  • Would I download the file from a hosted service in setUp?
  • Or is there a more accepted way to pass file paths into a unit test?

Aucun commentaire:

Enregistrer un commentaire