Skip to content

Commit 105b6a5

Browse files
committed
??? restore test_ZMQ - move execute() back into OMCSessionZMQ
1 parent 03e2413 commit 105b6a5

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

OMPython/OMCSession.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,6 @@ def __init__(self, session: OMCSessionZMQ, readonly=False):
9090
self._readonly = readonly
9191
self._omc_cache = {}
9292

93-
def execute(self, command):
94-
warnings.warn("This function is depreciated and will be removed in future versions; "
95-
"please use sendExpression() instead", DeprecationWarning, stacklevel=1)
96-
97-
return self.sendExpression(command, parsed=False)
98-
9993
@abc.abstractmethod
10094
def sendExpression(self, command, parsed=True):
10195
"""
@@ -550,6 +544,12 @@ def _connect_to_omc(self, timeout):
550544
self._omc.setsockopt(zmq.IMMEDIATE, True) # Queue messages only to completed connections
551545
self._omc.connect(self._port)
552546

547+
def execute(self, command):
548+
warnings.warn("This function is depreciated and will be removed in future versions; "
549+
"please use sendExpression() instead", DeprecationWarning, stacklevel=1)
550+
551+
return self.sendExpression(command, parsed=False)
552+
553553
def sendExpression(self, command, parsed=True):
554554
p = self._omc_process.poll() # check if process is running
555555
if p is not None:

tests/test_ZMQ.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def testSimulate(self):
4141
self.clean()
4242

4343
def test_execute(self):
44-
# self.assertEqual('"HelloWorld!"\n', self.om.execute('"HelloWorld!"'))
44+
self.assertEqual('"HelloWorld!"\n', self.om.execute('"HelloWorld!"'))
4545
self.assertEqual('"HelloWorld!"\n', self.om.sendExpression('"HelloWorld!"', parsed=False))
4646
self.assertEqual('HelloWorld!', self.om.sendExpression('"HelloWorld!"', parsed=True))
4747
self.clean()

0 commit comments

Comments
 (0)