From af0764cd61060c922f0e86f2d66e3c81dc6684bc Mon Sep 17 00:00:00 2001 From: Grzegorz Orczykowski <grzesiek2010@gmail.com> Date: Mon, 25 Sep 2023 13:57:36 +0200 Subject: [PATCH] Include the row number in the error message --- pyxform/xls2json.py | 5 ++++- tests/test_image_app_parameter.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pyxform/xls2json.py b/pyxform/xls2json.py index d107bf0d..771f815d 100644 --- a/pyxform/xls2json.py +++ b/pyxform/xls2json.py @@ -1342,7 +1342,10 @@ def workbook_to_json( new_dict["control"] = new_dict.get("control", {}) new_dict["control"].update({"intent": app_package_name}) else: - raise PyXFormError("Invalid Android package name format.") + raise PyXFormError( + (ROW_FORMAT_STRING % row_number) + + " Invalid Android package name format." + ) parent_children_array.append(new_dict) continue diff --git a/tests/test_image_app_parameter.py b/tests/test_image_app_parameter.py index afecfdca..9f87c49c 100644 --- a/tests/test_image_app_parameter.py +++ b/tests/test_image_app_parameter.py @@ -29,7 +29,7 @@ def test_throwing_error_when_invalid_android_package_name_is_used(self): | | type | name | label | parameters | appearance | | | image | my_image | Image | app=something | {case} | """ - error__contains = (["Invalid Android package name format"],) + error__contains = (["[row = 2] Invalid Android package name format"],) for case in appearances: with self.subTest(msg=case): self.assertPyxformXform(