twoscoops / twoscoops/Creating-and-Distributing-Python-Packages

Add CLI test changes and explanation

Aperta
#23 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Nessun dato sulla lingua
Stelle
8
Fork
0
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

## Location within the Course

* Section:5
* Lesson:1
* Language:English

## Description

We create the CLI in 5.1 but we don't talk about how to make the `test_command_line_interface` in `test_.py` work.

If there are inputs for the command line, they need to be specified as strings in a list as in `result = runner.invoke(cli.main, ['4'])`.

Also, maybe because of the way we have a `cli.py` file, calling `help_result = runner.invoke(cli.main, ['--help'])` in the test code gives a different answer than ` --help` on the command line. Instead of "Usage: \", it returns "Usage: main".

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.