def _mock_console_input(self, isatty=True): with patch('streamlink_cli.console.sys.stdin.isatty', return_value=isatty): mock_console = MagicMock() mock_console.ask.return_value = "username" mock_console.askpass.return_value = "password" yield ConsoleUserInputRequester(mock_console)
def setup_streamlink(): """Creates the Streamlink session.""" global streamlink streamlink = Streamlink( {"user-input-requester": ConsoleUserInputRequester(console)})