Build a RuntimeConfig mock with distinct timeout values.
(self, chunk=45.0, first_chunk=60.0, global_t=300.0)
| 770 | """Tests for differentiated first-chunk vs subsequent-chunk timeouts.""" |
| 771 | |
| 772 | def _make_rc(self, chunk=45.0, first_chunk=60.0, global_t=300.0): |
| 773 | """Build a RuntimeConfig mock with distinct timeout values.""" |
| 774 | from mcp_cli.config.enums import TimeoutType |
| 775 | |
| 776 | def get_timeout(t): |
| 777 | if t == TimeoutType.STREAMING_FIRST_CHUNK: |
| 778 | return first_chunk |
| 779 | elif t == TimeoutType.STREAMING_CHUNK: |
| 780 | return chunk |
| 781 | elif t == TimeoutType.STREAMING_GLOBAL: |
| 782 | return global_t |
| 783 | return 30.0 |
| 784 | |
| 785 | rc = MagicMock() |
| 786 | rc.get_timeout = MagicMock(side_effect=get_timeout) |
| 787 | return rc |
| 788 | |
| 789 | @pytest.mark.asyncio |
| 790 | async def test_first_chunk_uses_longer_timeout(self): |
no outgoing calls
no test coverage detected