diff --git a/src/code42cli/cmds/cases.py b/src/code42cli/cmds/cases.py index dc862967..be415d5a 100644 --- a/src/code42cli/cmds/cases.py +++ b/src/code42cli/cmds/cases.py @@ -275,7 +275,7 @@ def bulk(state): FILE_EVENTS_HEADERS = [ "number", - "eventId", + "event_id", ] case_file_events_generate_template = generate_template_cmd_factory( @@ -288,15 +288,15 @@ def bulk(state): @bulk.command( name="add", help="Bulk associate file events to cases using a CSV file with " - "format: {}.".format(",".join(FILE_EVENTS_HEADERS)), + f"format: {','.join(FILE_EVENTS_HEADERS)}.", ) @read_csv_arg(headers=FILE_EVENTS_HEADERS) @sdk_options() def bulk_add(state, csv_rows): sdk = state.sdk - def handle_row(case_number, event_id): - sdk.cases.file_events.add(case_number, event_id) + def handle_row(number, event_id): + sdk.cases.file_events.add(number, event_id) run_bulk_process( handle_row, csv_rows, progress_label="Associating file events to cases:", @@ -306,15 +306,15 @@ def handle_row(case_number, event_id): @bulk.command( name="remove", help="Bulk remove the file event association from cases using a CSV file with " - "format: {}.".format(",".join(FILE_EVENTS_HEADERS)), + f"format: {','.join(FILE_EVENTS_HEADERS)}.", ) @read_csv_arg(headers=FILE_EVENTS_HEADERS) @sdk_options() def bulk_remove(state, csv_rows): sdk = state.sdk - def handle_row(case_number, event_id): - sdk.cases.file_events.delete(case_number, event_id) + def handle_row(number, event_id): + sdk.cases.file_events.delete(number, event_id) run_bulk_process( handle_row, diff --git a/tests/cmds/test_cases.py b/tests/cmds/test_cases.py index 25392b3f..ee646ac8 100644 --- a/tests/cmds/test_cases.py +++ b/tests/cmds/test_cases.py @@ -472,15 +472,15 @@ def test_add_bulk_file_events_to_cases_uses_expected_arguments( bulk_processor = mocker.patch("code42cli.cmds.cases.run_bulk_process") with runner.isolated_filesystem(): with open("test_add.csv", "w") as csv: - csv.writelines(["number,eventId\n", "1,abc\n", "2,pqr\n"]) + csv.writelines(["number,event_id\n", "1,abc\n", "2,pqr\n"]) runner.invoke( cli, ["cases", "file-events", "bulk", "add", "test_add.csv"], obj=cli_state_with_user, ) assert bulk_processor.call_args[0][1] == [ - {"number": "1", "eventId": "abc"}, - {"number": "2", "eventId": "pqr"}, + {"number": "1", "event_id": "abc"}, + {"number": "2", "event_id": "pqr"}, ] @@ -490,13 +490,13 @@ def test_remove_bulk_file_events_from_cases_uses_expected_arguments( bulk_processor = mocker.patch("code42cli.cmds.cases.run_bulk_process") with runner.isolated_filesystem(): with open("test_remove.csv", "w") as csv: - csv.writelines(["number,eventId\n", "1,abc\n", "2,pqr\n"]) + csv.writelines(["number,event_id\n", "1,abc\n", "2,pqr\n"]) runner.invoke( cli, ["cases", "file-events", "bulk", "remove", "test_remove.csv"], obj=cli_state_with_user, ) assert bulk_processor.call_args[0][1] == [ - {"number": "1", "eventId": "abc"}, - {"number": "2", "eventId": "pqr"}, + {"number": "1", "event_id": "abc"}, + {"number": "2", "event_id": "pqr"}, ]