fix(sfm): a different UM serial at a held address is refused (409), not swapped

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
This commit is contained in:
serversdownandClaude Opus 5.5 committed 2026-10-21 01:45:17 -04:00
1 parent aa79e996c5
commit d393a149f8
2 files changed
+18 -3

No files matched your search

+13 -2
View File
@@ -79,12 +79,23 @@ def test_a_dropped_line_is_called_up_again_quietly():
assert st.series == 4 and second.opened == 1
def test_a_different_serial_at_the_same_address_hangs_up_the_old_line():
def test_a_different_serial_at_a_held_address_is_refused_without_io():
first, second = FakeMicromateClient(), FakeMicromateClient(serial="UM12947")
da = access(s4=[first, second])
da.status(ADDR, "UM20147")
with pytest.raises(WrongUnit, match="hangup"):
da.status(ADDR, "UM12947")
assert first.closed == 0 and second.opened == 0
assert da.held_serial(ADDR) == "UM20147"
def test_a_different_serial_replaces_a_session_that_is_no_longer_open():
first, second = FakeMicromateClient(), FakeMicromateClient(serial="UM12947")
da = access(s4=[first, second])
da.status(ADDR, "UM20147")
first.close()
da.status(ADDR, "UM12947")
assert first.closed == 1 and second.opened == 1
assert second.opened == 1
def test_a_busy_unit_answers_423_without_a_second_connection():