Skip to content
Snippets Groups Projects
Commit b8a899f3 authored by dwmorris11's avatar dwmorris11
Browse files

ran make to fix format issues in test

parent 93cf05ab
Branches
Tags
No related merge requests found
......@@ -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()
......
......@@ -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()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment