Commit graph

7 commits

Author SHA1 Message Date
Alex Pyrgiotis
51d4fb04c8
tests: Tokenize CLI arguments
Pass tokenized arguments (i.e., arguments as lists of strings) to CLI
invocations, else Click will attempt to tokenize them internally. The
problem with leaving tokenization to Click is that it uses
`shlex.split()`, which is Unix-oriented, and may miss some cases in
Windows.
2022-10-25 19:09:22 +03:00
Alex Pyrgiotis
6b7797639c
tests: Wrap Click results with extra functionality
Wrap Click results (`Result`) with a new class (`CLIResult`), which
includes:

1. Assertion statements.
2. Logic for formatting and printing a Click result.
3. Invocation arguments, which are missing from the original `Result`
   class.
2022-10-25 19:09:17 +03:00
deeplow
c0f0e7bf6a
move banner() code to cli & version() to util
- display_banner() was only displayed in CLI mode so it makes sense
for it to be in the CLI.
- get_version(), was mvoed to util since it is a static function
that is needed in multiple parts of the application.
2022-09-15 10:40:31 +01:00
deeplow
0f4e6e9156
create non-ascii filename test cases dynamically instead of static PDF
originally PDF files were included for these edge-cases but in
reality all we want to test is the filename itself. So it reduces
repo size if we have them generated dynamically.
2022-09-13 13:38:33 +01:00
deeplow
d3f478b17f
migrate to pytest & test_docs -> tests/test_docs
Use pytest instead of unittest to have greater flexibility in test
parametrization.
2022-09-13 13:07:58 +01:00
deeplow
84acf116c7
remove non-implemented tests
Since we're not doing test-drive-development, we should not have
tests for unimplemented features.
2022-09-13 13:07:12 +01:00
deeplow
377665c459
move tests to project root 2022-09-13 13:07:10 +01:00
Renamed from dangerzone/tests/test_cli.py (Browse further)