Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Semantic Router
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mirrored_repos
MachineLearning
aurelio-labs
Semantic Router
Commits
b8a899f3
Commit
b8a899f3
authored
1 year ago
by
dwmorris11
Browse files
Options
Downloads
Patches
Plain Diff
ran make to fix format issues in test
parent
93cf05ab
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/unit/encoders/test_mistral.py
+9
-6
9 additions, 6 deletions
tests/unit/encoders/test_mistral.py
tests/unit/llms/test_llm_mistral.py
+3
-5
3 additions, 5 deletions
tests/unit/llms/test_llm_mistral.py
with
12 additions
and
11 deletions
tests/unit/encoders/test_mistral.py
+
9
−
6
View file @
b8a899f3
...
...
@@ -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
()
...
...
This diff is collapsed.
Click to expand it.
tests/unit/llms/test_llm_mistral.py
+
3
−
5
View file @
b8a899f3
...
...
@@ -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
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment