diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b8e95d2..c282d3ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/docs/requirements.txt b/docs/requirements.txt index 37ab4af6..4fffce75 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,2 +1,2 @@ -click==7.1.2 +click==8.0.0 sphinx-click==2.5.0 diff --git a/setup.py b/setup.py index c123e5b6..362119d1 100644 --- a/setup.py +++ b/setup.py @@ -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", diff --git a/src/code42cli/__version__.py b/src/code42cli/__version__.py index 638c1217..d3880229 100644 --- a/src/code42cli/__version__.py +++ b/src/code42cli/__version__.py @@ -1 +1 @@ -__version__ = "1.16.0" +__version__ = "1.16.1" diff --git a/tests/cmds/test_departing_employee.py b/tests/cmds/test_departing_employee.py index feafddd6..d682709b 100644 --- a/tests/cmds/test_departing_employee.py +++ b/tests/cmds/test_departing_employee.py @@ -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, @@ -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 ) @@ -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 ) diff --git a/tests/cmds/test_securitydata.py b/tests/cmds/test_securitydata.py index b41e16fc..a062be4d 100644 --- a/tests/cmds/test_securitydata.py +++ b/tests/cmds/test_securitydata.py @@ -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 @@ -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 diff --git a/tests/cmds/test_trustedactivities.py b/tests/cmds/test_trustedactivities.py index df27af18..4efe5766 100644 --- a/tests/cmds/test_trustedactivities.py +++ b/tests/cmds/test_trustedactivities.py @@ -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." @@ -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):