text: import requests
  
  from hypermodern_radifar import console
  
  
  def test_main_succeeds(runner, mock_requests_get):
      result = runner.invoke(console.main)
      assert result.exit_code == 0
  
  
  def test_main_prints_title(runner, mock_requests_get):
      result = runner.invoke(console.main)
      assert "Lorem Ipsum" in result.output
  
  
  def test_main_uses_en_wikipedia_org(runner, mock_requests_get):
      runner.invoke(console.main)
      args, _ = mock_requests_get.call_args
      assert "en.wikipedia.org" in args[0]
  
  
  def test_main_fails_on_request_error(runner, mock_requests_get):
      mock_requests_get.side_effect = Exception("Boom")
      result = runner.invoke(console.main)
      assert result.exit_code == 1
  
  
  def test_main_prints_message_on_request_error(runner, mock_requests_get):
      mock_requests_get.side_effect = requests.RequestException
      result = runner.invoke(console.main)
      assert "Error" in result.output
  
  
  def test_main_uses_specified_language(runner, mock_wikipedia_random_page):
      runner.invoke(console.main, ["--language=pl"])
      mock_wikipedia_random_page.assert_called_with(language="pl")
  