mercredi 25 mars 2020

How would you test a python script that uses os import and creates new folders etc?

I'm not sure if there is a nice way to test something like this but maybe you know one:

I have written a python script that looks for changes (files added) within some given directories and if it detect added files, it runs a subprocess() on them which takes 1 to 2 hours. Then it moves files, deletes and renames folders etc.

Now I'm sick of testing it manually every time I add some changes, but I also have no clue how to test this using autotests. Does anyone has an idea?

Thanks!

Aucun commentaire:

Enregistrer un commentaire