Skip to content

Commit

Permalink
Merge pull request #48 from GoogleCloudPlatform/patryklawski_bg_impor…
Browse files Browse the repository at this point in the history
…t_extension_for_categories_patch_v2

Typo fix. Minor review changes in Readme.md
  • Loading branch information
patrykel authored Oct 30, 2023
2 parents 304d8cc + d14610e commit a8f92f0
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ export GCLOUD_ACCESS_TOKEN=$(gcloud auth print-access-token)

The source CSV files shall adhere to RFC4180 format.

However, currently, we do not allow a header line and all records should be
encoded in UTF-8 charset. We expect values to be separated by comma (`,`)
character.

### Categories CSV schema

Each record in the categories CSV file represents a single category with the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,7 @@ def create_error_message(
or extract_error_code(response_err)
or base_err_description
)
error_msg = f'{method_name} call to {url} returned: {err_description}'
return error_msg
return f'{method_name} call to {url} returned: {err_description}'


def fetch_api_response(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ def import_glossary(
logger.error(
'Errors occurred during categories import.%s', error_log_suffix
)
user_report.print_report_for_erronous_categories_import(
user_report.print_report_for_erroneous_categories_import(
imported_categories, categories_import_errors
)
utils.end_program_execution()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ def test_glossary_print_report_and_exit_on_categories_import_error(self):
return_value=expected_import_glossary_terms_ret,
)
)
mock_print_report_for_erronous_categories_import = self.enterContext(
mock_print_report_for_erroneous_categories_import = self.enterContext(
mock.patch.object(
user_report, "print_report_for_erronous_categories_import"
user_report, "print_report_for_erroneous_categories_import"
)
)
mock_end_program_execution = self.enterContext(
Expand All @@ -104,7 +104,7 @@ def test_glossary_print_report_and_exit_on_categories_import_error(self):
glossary.import_glossary(terms, categories)

mock_import_glossary_categories.assert_called_once_with(categories)
mock_print_report_for_erronous_categories_import.assert_called_once_with(
mock_print_report_for_erroneous_categories_import.assert_called_once_with(
expected_imported_categories, expected_categories_import_errors
)
mock_end_program_execution.assert_called_once()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
]


# Typo erronous
def print_report_for_erronous_categories_import(
def print_report_for_erroneous_categories_import(
imported_categories: list[bg_category.Category],
categories_import_errors: list[error.EntryImportError],
) -> None:
Expand Down

0 comments on commit a8f92f0

Please sign in to comment.