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

Add CLI test changes and explanation

Open
#23 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
8
Forks
0
PR merge metrics
No merged PRs in 30d

Description

## 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".

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.