Skip to content

Commit

Permalink
Merge pull request #8 from ISISComputingGroup/Ticket8579
Browse files Browse the repository at this point in the history
Overwrite error_log_func
  • Loading branch information
rerpha authored Nov 28, 2024
2 parents 9343472 + 8169994 commit 602d5cd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/genie_python/genie_epics_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def __init__(
else:
self._environment_details = environment_details

Wrapper.errorLogFunc = self.logger.log_ca_msg
Wrapper.error_log_func = self.logger.log_ca_msg

# disable CA error messages to console from disconnected PVs
import ctypes
Expand Down
3 changes: 3 additions & 0 deletions tests/test_genie_epics_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@ def test_GIVEN_pv_name_WHEN_pv_not_connected_THEN_get_pv_alarm(self):

self.assertEqual(self.api.get_pv_alarm("DISCONNECTED_PV"), "UNKNOWN")

def test_GIVEN_api_is_imported_THEN_error_log_func_overwritten_on_wrapper(self):
self.assertEqual(self.mock_wrapper.error_log_func, self.api.logger.log_ca_msg)


class TestEpicsApiSetInstrumentName(unittest.TestCase):
def setUp(self):
Expand Down

0 comments on commit 602d5cd

Please sign in to comment.