Skip to content

Commit bac23a3

Browse files
authored
chore/update-click-8.0 (#392)
* chore/update-click-8.0 * remove click version upper limit * test for both click <8 and >=8 error messages * prep for release
1 parent c4bbdb0 commit bac23a3

File tree

7 files changed

+28
-7
lines changed

7 files changed

+28
-7
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88
The intended audience of this file is for py42 consumers -- as such, changes that don't affect
99
how a consumer would use the library (e.g. adding unit tests, updating documentation, etc) are not captured here.
1010

11+
## 1.16.1 - 2022-10-10
12+
13+
### Added
14+
15+
- Support for `click` version `>=8.0.0`.
16+
1117
## 1.16.0 - 2022-10-06
1218

1319
### Added

docs/requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
click==7.1.2
1+
click==8.0.0
22
sphinx-click==2.5.0

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
python_requires=">=3.6.2, <4",
3333
install_requires=[
3434
"chardet",
35-
"click>=7.1.1, <8",
35+
"click==7.1.1",
3636
"click_plugins>=1.1.1",
3737
"colorama>=0.4.3",
3838
"keyring==18.0.1",

src/code42cli/__version__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "1.16.0"
1+
__version__ = "1.16.1"

tests/cmds/test_departing_employee.py

+7
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,7 @@ def test_remove_bulk_users_uses_expected_arguments_when_flat_file(
353353
def test_add_departing_employee_when_invalid_date_validation_raises_error(
354354
runner, cli_state_with_user
355355
):
356+
# day is out of range for month
356357
departure_date = "2020-02-30"
357358
result = runner.invoke(
358359
cli,
@@ -367,6 +368,9 @@ def test_add_departing_employee_when_invalid_date_validation_raises_error(
367368
)
368369
assert result.exit_code == 2
369370
assert (
371+
"Invalid value for '--departure-date': '2020-02-30' does not match the format '%Y-%m-%d'"
372+
in result.output # invalid datetime format
373+
) or (
370374
"Invalid value for '--departure-date': invalid datetime format" in result.output
371375
)
372376

@@ -388,6 +392,9 @@ def test_add_departing_employee_when_invalid_date_format_validation_raises_error
388392
)
389393
assert result.exit_code == 2
390394
assert (
395+
"Invalid value for '--departure-date': '2020-30-01' does not match the format '%Y-%m-%d'"
396+
in result.output
397+
) or (
391398
"Invalid value for '--departure-date': invalid datetime format" in result.output
392399
)
393400

tests/cmds/test_securitydata.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,10 @@ def test_search_and_send_to_when_advanced_query_passed_non_existent_filename_rai
326326
cli, [*command, "--advanced-query", "@not_a_file"], obj=cli_state
327327
)
328328
assert result.exit_code == 2
329-
assert "Could not open file: not_a_file" in result.stdout
329+
assert (
330+
" Invalid value for '--advanced-query': 'not_a_file': No such file or directory"
331+
in result.stdout
332+
) or ("Could not open file: not_a_file" in result.stdout)
330333

331334

332335
@search_and_send_to_test
@@ -724,7 +727,9 @@ def test_search_and_send_to_when_given_invalid_exposure_type_causes_exit(
724727
obj=cli_state,
725728
)
726729
assert result.exit_code == 2
727-
assert "invalid choice: NotValid" in result.output
730+
assert (
731+
"Invalid value" in result.output or "invalid choice: NotValid" in result.output
732+
)
728733

729734

730735
@search_and_send_to_test

tests/cmds/test_trustedactivities.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"""
3939

4040
MISSING_ARGUMENT_ERROR = "Missing argument '{}'."
41-
MISSING_TYPE = MISSING_ARGUMENT_ERROR.format("[DOMAIN|SLACK]")
41+
MISSING_TYPE = MISSING_ARGUMENT_ERROR.format("{DOMAIN|SLACK}")
4242
MISSING_VALUE = MISSING_ARGUMENT_ERROR.format("VALUE")
4343
MISSING_RESOURCE_ID_ARG = MISSING_ARGUMENT_ERROR.format("RESOURCE_ID")
4444
RESOURCE_ID_NOT_FOUND_ERROR = "Resource ID '{}' not found."
@@ -114,7 +114,10 @@ def test_create_when_missing_type_prints_error(runner, cli_state):
114114
command = ["trusted-activities", "create", "--description", "description"]
115115
result = runner.invoke(cli, command, obj=cli_state)
116116
assert result.exit_code == 2
117-
assert MISSING_TYPE in result.output
117+
assert (
118+
MISSING_TYPE in result.output
119+
or MISSING_ARGUMENT_ERROR.format("[DOMAIN|SLACK]") in result.output
120+
)
118121

119122

120123
def test_create_when_missing_value_prints_error(runner, cli_state):

0 commit comments

Comments
 (0)