Ejemplo n.º 1
0
def test_gpibusbcomm_sendcmd_empty_string():
    comm = GPIBCommunicator(mock.MagicMock(), 1)
    comm._version = 5
    comm._file.sendcmd = mock.MagicMock()  # Refreshed because init makes calls

    comm._sendcmd("")
    comm._file.sendcmd.assert_not_called()
Ejemplo n.º 2
0
def test_gpibusbcomm_sendcmd_empty_string():
    comm = GPIBCommunicator(mock.MagicMock(), 1)
    comm._version = 5
    comm._file.sendcmd = mock.MagicMock()  # Refreshed because init makes calls

    comm._sendcmd("")
    comm._file.sendcmd.assert_not_called()
Ejemplo n.º 3
0
def test_gpibusbcomm_sendcmd():
    comm = GPIBCommunicator(mock.MagicMock(), 1)
    comm._version = 5

    comm._sendcmd("mock")
    comm._file.sendcmd.assert_has_calls([
        mock.call("+a:1"),
        mock.call("++eoi 1"),
        mock.call("++read_tmo_ms 1000.0"),
        mock.call("++eos 2"),
        mock.call("mock")
    ])
Ejemplo n.º 4
0
def test_gpibusbcomm_sendcmd():
    comm = GPIBCommunicator(mock.MagicMock(), 1)
    comm._version = 5

    comm._sendcmd("mock")
    comm._file.sendcmd.assert_has_calls([
        mock.call("+a:1"),
        mock.call("++eoi 1"),
        mock.call("++read_tmo_ms 1000.0"),
        mock.call("++eos 2"),
        mock.call("mock")
    ])