Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions instruments/abstract_instruments/comm/usbtmc_communicator.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def terminator(self):

:type: `str`
"""
return self._filelike.term_char
return chr(self._filelike.term_char)

@terminator.setter
def terminator(self, newval):
Expand All @@ -78,7 +78,7 @@ def timeout(self):

@timeout.setter
def timeout(self, newval):
newval = assume_units(newval, pq.second).rescale(pq.ms).magnitude
newval = assume_units(newval, pq.second).rescale(pq.s).magnitude
self._filelike.timeout = newval

# FILE-LIKE METHODS #
Expand Down
6 changes: 3 additions & 3 deletions instruments/tests/test_comm/test_usbtmc.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def test_usbtmccomm_init_missing_module():
def test_usbtmccomm_terminator_getter(mock_usbtmc):
comm = USBTMCCommunicator()

term_char = mock.PropertyMock(return_value="\n")
term_char = mock.PropertyMock(return_value=10)
type(comm._filelike).term_char = term_char

eq_(comm.terminator, "\n")
Expand Down Expand Up @@ -74,10 +74,10 @@ def test_usbtmccomm_timeout(mock_usbtmc):
timeout.assert_called_with()

comm.timeout = 10
timeout.assert_called_with(array(10000.0))
timeout.assert_called_with(array(10.0))

comm.timeout = 1000 * pq.millisecond
timeout.assert_called_with(array(1000.0))
timeout.assert_called_with(array(1.0))


@mock.patch(patch_path)
Expand Down