Example #1
0
def test_PexpectEngine_send_control_sends_correct_bytes(pty_pair_raw):
    engine = PexpectEngine()
    engine.open(console_fd=pty_pair_raw.main.fd)

    engine.send_control('C')

    assert pty_pair_raw.main.read(timeout=0.5) == b'^C'
Example #2
0
def test_PexpectEngine_error_on_invalid_code(pty_pair_raw):
    engine = PexpectEngine()
    engine.open(console_fd=pty_pair_raw.main.fd)

    with pytest.raises(Exception):
        engine.send_control('!')
Example #3
0
def test_PexpectEngine_error_on_control_longer_than_one_char(pty_pair_raw):
    engine = PexpectEngine()
    engine.open(console_fd=pty_pair_raw.main.fd)

    with pytest.raises(ValueError):
        engine.send_control('CC')