Securedrop: Write unit tests for manage commands

Created on 16 Jul 2017  路  3Comments  路  Source: freedomofpress/securedrop

Feature request

Description

The functions in manage.py are almost all marked with the # pragma: no cover to avoid having test coverage expect tests for them. There doesn't seem to be any particular reason why these shouldn't be tested.

more tests help wanted

Most helpful comment

https://github.com/freedomofpress/securedrop/pull/1850/files fixes a race and adds tests for one function. One step toward that goal ;-)

All 3 comments

Great point @zsck. Tagging this one for 0.4.1. I also wonder if some of the functionality in manage.py could be DRYed up (e.g. both journalist.py and manage.py adds users).

https://github.com/freedomofpress/securedrop/pull/1850/files fixes a race and adds tests for one function. One step toward that goal ;-)

A regression during the work #1509 showed that we need tests for _run_from_commandline for each subcommand because args.func(args) may call a function that "forgets" to accept the CLI args object as the singular argument.

Was this page helpful?
0 / 5 - 0 ratings