diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 55df4d5..4f0d5ee 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.11.2 +current_version = 0.11.4 commit = True tag = True diff --git a/hm_pyhelper/diagnostics/diagnostics_report.py b/hm_pyhelper/diagnostics/diagnostics_report.py index 3fff3ce..893acdc 100644 --- a/hm_pyhelper/diagnostics/diagnostics_report.py +++ b/hm_pyhelper/diagnostics/diagnostics_report.py @@ -80,7 +80,7 @@ def record_failure(self, msg_or_exception, diagnostic): self.record_result(record_failure_as, diagnostic) def get_report_subset(self, keys_to_extract): - return {key: self.__getattribute__(key) for key in keys_to_extract} + return {key: self.__getitem__(key) for key in keys_to_extract} def get_error_messages(self): def get_error_message(key): diff --git a/hm_pyhelper/tests/test_diagnostic_report.py b/hm_pyhelper/tests/test_diagnostic_report.py index 72d2fcc..c3d57b4 100644 --- a/hm_pyhelper/tests/test_diagnostic_report.py +++ b/hm_pyhelper/tests/test_diagnostic_report.py @@ -55,3 +55,12 @@ def test_get_error_messages(self): actual_msgs = diagnostics_report.get_error_messages() expected_msgs = "key1 Error: Error1\nkey2 Error: Error2" self.assertEqual(actual_msgs, expected_msgs) + + def test_get_report_subset(self): + diagnostics_report = DiagnosticsReport() + diagnostics_report['VA'] = 'NEBHNT-IN1' + diagnostics_report['foo'] = 'bar' + + self.assertDictEqual(diagnostics_report.get_report_subset(["VA"]), { + 'VA': 'NEBHNT-IN1' + }) diff --git a/setup.py b/setup.py index 5c54739..443cc8d 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ setup( name='hm_pyhelper', - version='0.11.3', + version='0.11.4', author="Nebra Ltd", author_email="support@nebra.com", description="Helium Python Helper",