Skip to content

chore/update-click-8.0 #392

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
The intended audience of this file is for py42 consumers -- as such, changes that don't affect
how a consumer would use the library (e.g. adding unit tests, updating documentation, etc) are not captured here.

## 1.16.1 - 2022-10-10

### Added

- Support for `click` version `>=8.0.0`.

## 1.16.0 - 2022-10-06

### Added
Expand Down
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
click==7.1.2
click==8.0.0
sphinx-click==2.5.0
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
python_requires=">=3.6.2, <4",
install_requires=[
"chardet",
"click>=7.1.1, <8",
"click==7.1.1",
"click_plugins>=1.1.1",
"colorama>=0.4.3",
"keyring==18.0.1",
Expand Down
2 changes: 1 addition & 1 deletion src/code42cli/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.16.0"
__version__ = "1.16.1"
7 changes: 7 additions & 0 deletions tests/cmds/test_departing_employee.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ def test_remove_bulk_users_uses_expected_arguments_when_flat_file(
def test_add_departing_employee_when_invalid_date_validation_raises_error(
runner, cli_state_with_user
):
# day is out of range for month
departure_date = "2020-02-30"
result = runner.invoke(
cli,
Expand All @@ -367,6 +368,9 @@ def test_add_departing_employee_when_invalid_date_validation_raises_error(
)
assert result.exit_code == 2
assert (
"Invalid value for '--departure-date': '2020-02-30' does not match the format '%Y-%m-%d'"
in result.output # invalid datetime format
) or (
"Invalid value for '--departure-date': invalid datetime format" in result.output
)

Expand All @@ -388,6 +392,9 @@ def test_add_departing_employee_when_invalid_date_format_validation_raises_error
)
assert result.exit_code == 2
assert (
"Invalid value for '--departure-date': '2020-30-01' does not match the format '%Y-%m-%d'"
in result.output
) or (
"Invalid value for '--departure-date': invalid datetime format" in result.output
)

Expand Down
9 changes: 7 additions & 2 deletions tests/cmds/test_securitydata.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,10 @@ def test_search_and_send_to_when_advanced_query_passed_non_existent_filename_rai
cli, [*command, "--advanced-query", "@not_a_file"], obj=cli_state
)
assert result.exit_code == 2
assert "Could not open file: not_a_file" in result.stdout
assert (
" Invalid value for '--advanced-query': 'not_a_file': No such file or directory"
in result.stdout
) or ("Could not open file: not_a_file" in result.stdout)


@search_and_send_to_test
Expand Down Expand Up @@ -724,7 +727,9 @@ def test_search_and_send_to_when_given_invalid_exposure_type_causes_exit(
obj=cli_state,
)
assert result.exit_code == 2
assert "invalid choice: NotValid" in result.output
assert (
"Invalid value" in result.output or "invalid choice: NotValid" in result.output
)


@search_and_send_to_test
Expand Down
7 changes: 5 additions & 2 deletions tests/cmds/test_trustedactivities.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"""

MISSING_ARGUMENT_ERROR = "Missing argument '{}'."
MISSING_TYPE = MISSING_ARGUMENT_ERROR.format("[DOMAIN|SLACK]")
MISSING_TYPE = MISSING_ARGUMENT_ERROR.format("{DOMAIN|SLACK}")
MISSING_VALUE = MISSING_ARGUMENT_ERROR.format("VALUE")
MISSING_RESOURCE_ID_ARG = MISSING_ARGUMENT_ERROR.format("RESOURCE_ID")
RESOURCE_ID_NOT_FOUND_ERROR = "Resource ID '{}' not found."
Expand Down Expand Up @@ -114,7 +114,10 @@ def test_create_when_missing_type_prints_error(runner, cli_state):
command = ["trusted-activities", "create", "--description", "description"]
result = runner.invoke(cli, command, obj=cli_state)
assert result.exit_code == 2
assert MISSING_TYPE in result.output
assert (
MISSING_TYPE in result.output
or MISSING_ARGUMENT_ERROR.format("[DOMAIN|SLACK]") in result.output
)


def test_create_when_missing_value_prints_error(runner, cli_state):
Expand Down