Commit abd9f8d
test(viewer): poll-and-decode load_browser stdout via PropertyMock
Copilot flagged that the existing tests pinned process.stdout to a
single bytes value, which doesn't match production where
sh.RunningCommand.process.stdout is a @Property returning the latest
accumulated buffer on each access — so the polling loop was effectively
exercising one read instead of N. Switch to mock.PropertyMock with a
chunks list so each poll inside load_browser() sees a different
buffer; the success-path test now genuinely verifies that the loop
re-reads stdout across iterations and finds the handshake on the
second poll.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent a637df0 commit abd9f8d
1 file changed
Lines changed: 33 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
76 | 92 | | |
77 | 93 | | |
78 | | - | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
79 | 101 | | |
80 | 102 | | |
81 | | - | |
82 | | - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
83 | 109 | | |
84 | 110 | | |
85 | 111 | | |
86 | 112 | | |
87 | 113 | | |
88 | 114 | | |
89 | | - | |
| 115 | + | |
90 | 116 | | |
91 | 117 | | |
92 | 118 | | |
| |||
99 | 125 | | |
100 | 126 | | |
101 | 127 | | |
102 | | - | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
103 | 131 | | |
104 | 132 | | |
105 | 133 | | |
| |||
0 commit comments