Skip to content

Commit

Permalink
add tests for Append command
Browse files Browse the repository at this point in the history
  • Loading branch information
aureocarneiro authored Aug 8, 2023
1 parent 3c473c2 commit f9ade96
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/test_pandablocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
GetPcapBitsLabels,
GetState,
Put,
Append,
SetState,
is_multiline_command,
)
Expand Down Expand Up @@ -188,6 +189,21 @@ def test_connect_put_no_value():
assert get_responses(conn, b"OK\n") == [(cmd, None)]


def test_connect_append():
conn = ControlConnection()
cmd = Append("SEQ1.TABLE", ["1048576", "0", "1000", "1000"])
assert conn.send(cmd) == b"SEQ1.TABLE<<\n1048576\n0\n1000\n1000\n\n"
assert get_responses(conn, b"OK\n") == [(cmd, None)]


def test_connect_append_multi_bad_list_format():
"""Confirm that an invalid data format raises the expected exception"""
conn = ControlConnection()
cmd = Append("SEQ1.TABLE", [1, 2, 3])
with pytest.raises(TypeError):
assert conn.send(cmd) == b""


def test_get_block_info():
conn = ControlConnection()
cmd = GetBlockInfo()
Expand Down

0 comments on commit f9ade96

Please sign in to comment.