Skip to content

fix(investigation): declare ranges for numeric CLI options (#1562) - #1673

Open
Mohit-Gaur75 wants to merge 1 commit into
pyrite-wiki:devfrom
Mohit-Gaur75:fix/1562-investigation-numeric-ranges
Open

Mohit-Gaur75 wants to merge 1 commit into
pyrite-wiki:devfrom
Mohit-Gaur75:fix/1562-investigation-numeric-ranges

Conversation

@Mohit-Gaur75

Copy link
Copy Markdown
Contributor

Resolves #1562. Follows #1541.

Description

Declares the valid numeric ranges for all 13 numeric options across pyrite investigation CLI commands:

  • imeline: --min-importance (min=0, max=10), --limit (min=1)
  • entities: --min-importance (min=0, max=10), --limit (min=1)
  • sources: --limit (min=1)
  • claims: --min-importance (min=0, max=10), --limit (min=1)
  • qa: --stale-days (min=0)
  • search: --limit (min=1)
  • ownership: --depth (min=1)
  • money-flow: --hops (min=1)
  • export: --min-importance (min=0, max=10)
  • dedup: --threshold (min=0.0, max=1.0)

Removes all 13 rows from NOT_YET in ests/test_cli_numeric_options_declare_a_range.py and decrements NOT_YET_PINNED_SIZE from 29 to 16.

Adds unit tests in extensions/journalism-investigation/tests/test_cli_option_ranges.py asserting that out-of-range inputs exit with code 2 and print usage error messages naming the option.

Changelog: fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pyrite investigation numeric options (limits, importance, depth, hops, threshold) accept values outside their range (declare the ranges; #1541)

1 participant