Ejemplo n.º 1
0
def test_display_set():
    mock = HcsMock()
    hcs = HcsCom(port=mock)
    volt = 12
    hcs.set_voltage(volt)
    assert mock.display_values[0] == volt
    curr = 5
    hcs.set_current(curr)
    assert mock.display_values[1] == curr
Ejemplo n.º 2
0
def test_display_set_format_four_digits():
    mock = HcsMock()
    mock.set_format(FORMAT_FOUR_DIGITS)
    hcs = HcsCom(port=mock)
    assert hcs.value_format == FORMAT_FOUR_DIGITS
    volt = 12
    hcs.set_voltage(volt)
    assert mock.display_values[0] == volt
    curr = 5
    hcs.set_current(curr)
    assert mock.display_values[1] == curr