Skip to content

Commit 057377b

Browse files
committed
Split tests
1 parent b324323 commit 057377b

1 file changed

Lines changed: 22 additions & 7 deletions

File tree

tests/settings/test_settings_embedders.py

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,10 @@ def test_reset_embedders(new_embedders, empty_index):
4444
assert response_last is None
4545

4646

47-
def test_embedder_format_fields(empty_index):
48-
"""Tests that each embedder type has the required fields and proper format."""
47+
def test_openai_embedder_format(empty_index):
48+
"""Tests that OpenAi embedder has the required fields and proper format."""
4949
index = empty_index()
5050

51-
# Test OpenAi embedder
5251
openai_embedder = {
5352
"openai": {
5453
"source": "openAi",
@@ -72,7 +71,11 @@ def test_embedder_format_fields(empty_index):
7271
assert embedders.embedders["openai"].distribution.sigma == 0.1
7372
assert embedders.embedders["openai"].binary_quantized is False
7473

75-
# Test HuggingFace embedder
74+
75+
def test_huggingface_embedder_format(empty_index):
76+
"""Tests that HuggingFace embedder has the required fields and proper format."""
77+
index = empty_index()
78+
7679
huggingface_embedder = {
7780
"huggingface": {
7881
"source": "huggingFace",
@@ -95,7 +98,11 @@ def test_embedder_format_fields(empty_index):
9598
assert embedders.embedders["huggingface"].distribution.sigma == 0.1
9699
assert embedders.embedders["huggingface"].binary_quantized is False
97100

98-
# Test Ollama embedder
101+
102+
def test_ollama_embedder_format(empty_index):
103+
"""Tests that Ollama embedder has the required fields and proper format."""
104+
index = empty_index()
105+
99106
ollama_embedder = {
100107
"ollama": {
101108
"source": "ollama",
@@ -121,7 +128,11 @@ def test_embedder_format_fields(empty_index):
121128
assert embedders.embedders["ollama"].distribution.sigma == 0.1
122129
assert embedders.embedders["ollama"].binary_quantized is False
123130

124-
# Test Rest embedder
131+
132+
def test_rest_embedder_format(empty_index):
133+
"""Tests that Rest embedder has the required fields and proper format."""
134+
index = empty_index()
135+
125136
rest_embedder = {
126137
"rest": {
127138
"source": "rest",
@@ -151,7 +162,11 @@ def test_embedder_format_fields(empty_index):
151162
assert embedders.embedders["rest"].distribution.sigma == 0.1
152163
assert embedders.embedders["rest"].binary_quantized is False
153164

154-
# Test UserProvided embedder
165+
166+
def test_user_provided_embedder_format(empty_index):
167+
"""Tests that UserProvided embedder has the required fields and proper format."""
168+
index = empty_index()
169+
155170
user_provided_embedder = {
156171
"user_provided": {
157172
"source": "userProvided",

0 commit comments

Comments
 (0)