From b8a899f3e5c1c0f4abfac01deedb35638efb8d58 Mon Sep 17 00:00:00 2001 From: dwmorris11 <dustin.morris@outlook.com> Date: Sun, 11 Feb 2024 23:19:43 -0800 Subject: [PATCH] ran make to fix format issues in test --- tests/unit/encoders/test_mistral.py | 15 +++++++++------ tests/unit/llms/test_llm_mistral.py | 8 +++----- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/tests/unit/encoders/test_mistral.py b/tests/unit/encoders/test_mistral.py index ec8ad8d1..c2a91c12 100644 --- a/tests/unit/encoders/test_mistral.py +++ b/tests/unit/encoders/test_mistral.py @@ -29,13 +29,13 @@ class TestMistralEncoder: assert "Mistral client not initialized" in str(e.value) def test_mistralai_encoder_init_exception(self, mocker): - mocker.patch("mistralai.client.MistralClient", side_effect=Exception("Initialization error")) + mocker.patch( + "mistralai.client.MistralClient", + side_effect=Exception("Initialization error"), + ) with pytest.raises(ValueError) as e: MistralEncoder() - assert ( - "Mistral API key not provided" - in str(e.value) - ) + assert "Mistral API key not provided" in str(e.value) def test_mistralai_encoder_call_success(self, mistralai_encoder, mocker): mock_embeddings = mocker.Mock() @@ -90,7 +90,10 @@ class TestMistralEncoder: with pytest.raises(ValueError) as e: mistralai_encoder(["test document"]) - assert "Unable to connect to MistralAI ('Non-MistralException',): Non-MistralException" in str(e.value) + assert ( + "Unable to connect to MistralAI ('Non-MistralException',): Non-MistralException" + in str(e.value) + ) def test_mistralai_encoder_call_successful_retry(self, mistralai_encoder, mocker): mock_embeddings = mocker.Mock() diff --git a/tests/unit/llms/test_llm_mistral.py b/tests/unit/llms/test_llm_mistral.py index 987fbb24..4e01ca5a 100644 --- a/tests/unit/llms/test_llm_mistral.py +++ b/tests/unit/llms/test_llm_mistral.py @@ -35,14 +35,12 @@ class TestMistralAILLM: def test_mistralai_llm_init_exception(self, mocker): mocker.patch( - "mistralai.client.MistralClient", side_effect=Exception("Initialization error") + "mistralai.client.MistralClient", + side_effect=Exception("Initialization error"), ) with pytest.raises(ValueError) as e: MistralAILLM() - assert ( - "MistralAI API key cannot be 'None'." - in str(e.value) - ) + assert "MistralAI API key cannot be 'None'." in str(e.value) def test_mistralai_llm_call_success(self, mistralai_llm, mocker): mock_completion = mocker.MagicMock() -- GitLab