Closed simonw closed 1 year ago
Oops:
mock_palm = <MagicMock name='palm' id='140718416327120'> @patch("llm_palm.palm") def test_palm_models(mock_palm): fake_models = [ {"name": "'models/chat-bison-001"}, {"name": "models/text-bison-001"}, ] # Mock palm.list_models() mock_palm.list_models.return_value = fake_models runner = CliRunner() result = runner.invoke(cli, ["palm", "models"]) > assert result.exit_code == 0, result.output E AssertionError: Error: No key found - add one using 'llm keys set palm' or set the PALM_API_KEY environment variable E E assert 1 == 0 E + where 1 = <Result SystemExit(1)>.exit_code tests/test_llm_palm.py:33: AssertionError _______________________________ test_palm_prompt _______________________________ mock_palm = <MagicMock name='palm' id='140718416285008'> @patch("llm_palm.palm") def test_palm_prompt(mock_palm): mock_response = Mock() mock_response.last = "🐶🐶" mock_palm.chat.return_value = mock_response runner = CliRunner() result = runner.invoke(cli, ["two dog emoji", "-m", "palm"]) > assert result.exit_code == 0, result.output E AssertionError: Error: No key found - add one using 'llm keys set palm' E E assert 1 == 0 E + where 1 = <Result SystemExit(1)>.exit_code
Oops: