Mock user_response method for testing
(
self,
msg: Optional[str | ChatDocument] = None,
)
| 99 | |
| 100 | class MockAgent(ChatAgent): |
| 101 | def user_response( |
| 102 | self, |
| 103 | msg: Optional[str | ChatDocument] = None, |
| 104 | ) -> Optional[ChatDocument]: |
| 105 | """ |
| 106 | Mock user_response method for testing |
| 107 | """ |
| 108 | txt = msg if isinstance(msg, str) else msg.content |
| 109 | map = dict([("2", "3"), ("3", "5")]) |
| 110 | response = map.get(txt) |
| 111 | # return the increment of input number |
| 112 | return self.create_user_response(response) |
| 113 | |
| 114 | |
| 115 | @pytest.mark.parametrize("interactive", [True, False]) |
no test coverage detected