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

Add CLI test changes and explanation

未关闭
#23 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
没有语言数据
星标
8
派生
0
PR 合并指标
30 天内没有已合并 PR

描述

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

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。