Skip to content

Commit

Permalink
issue #17: frame: Add unit tests for emitting SABM(E)
Browse files Browse the repository at this point in the history
  • Loading branch information
sjlongland committed May 4, 2024
1 parent ff89b4e commit d96c9f7
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions tests/test_frame/test_uframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,36 @@ def test_encode_pf():
eq_(frame.control, 0x13)


def test_encode_sabm():
"""
Test we can encode a SABM frame.
"""
frame = AX25SetAsyncBalancedModeFrame(
destination="VK4BWI", source="VK4MSL"
)
hex_cmp(
bytes(frame),
"ac 96 68 84 ae 92 e0" # Destination
"ac 96 68 9a a6 98 61" # Source
"3f", # Control byte
)


def test_encode_sabme():
"""
Test we can encode a SABME frame.
"""
frame = AX25SetAsyncBalancedModeExtendedFrame(
destination="VK4BWI", source="VK4MSL"
)
hex_cmp(
bytes(frame),
"ac 96 68 84 ae 92 e0" # Destination
"ac 96 68 9a a6 98 61" # Source
"7f", # Control byte
)


def test_encode_frmr_w():
"""
Test we can set the W bit on a FRMR frame.
Expand Down

0 comments on commit d96c9f7

Please sign in to comment.