jeudi 26 octobre 2017

Python Testing a CLI application

First off: I am quite new to the field of testing. So there might be some things wrong in my understanding.

My situation is the following: I'm working on a framework-ish where the end-user has to inherit from a parent class I've predefined. They're required to override four abstract methods I've defined in the parent class, and write there magic code inside of these methods.

The framework offers three different modes to run in. Because I want to ensure no mistakes are being made I've added a positional CLI argument to set that mode.

Here is my problem: I'm trying to write a unittest for every module in my application. Because the parent class mentioned above has quite some code, I'd like to unittest this as well.

Needless to say, it will not run without providing the required positional argument.

I've looked around to see how I can provide this argument programmatically, but the internet tells me that a unittest should be able to run without any outside information (makes sense).

My question: How do I test such a module? Are there other types of tests that are suited for these kinds of problems?

Thank you in advance!

Aucun commentaire:

Enregistrer un commentaire