Exemplo n.º 1
0
def test_self_calibration_failed(b1500):
    mock_ask = MagicMock()
    b1500.ask = mock_ask

    expected_response = CALResponse(1) + CALResponse(64)
    mock_ask.return_value = '65'

    response = b1500.self_calibration()

    assert response == expected_response
    mock_ask.assert_called_once_with('*CAL?')
Exemplo n.º 2
0
def test_self_calibration_successful(b1500):
    mock_ask = MagicMock()
    b1500.ask = mock_ask

    mock_ask.return_value = '0'

    response = b1500.self_calibration()

    assert response == CALResponse(0)
    mock_ask.assert_called_once_with('*CAL?')