Skip to content

Commit 8ff9706

Browse files
make the test more compact
1 parent 3fc2021 commit 8ff9706

File tree

1 file changed

+3
-31
lines changed

1 file changed

+3
-31
lines changed

test_unstructured_client/unit/test_split_pdf_hook.py

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -48,38 +48,10 @@ def test_unit_clear_operation(self):
4848
def test_unit_get_split_pdf_call_threads_default(self):
4949
"""Test get split pdf call threads method returns the right values."""
5050
hook = SplitPdfHook()
51-
5251
assert hook._get_split_pdf_call_threads({}) == DEFAULT_NUM_THREADS
53-
54-
# Test custom value
55-
assert (
56-
hook._get_split_pdf_call_threads(
57-
{
58-
"split_pdf_threads": 10,
59-
}
60-
)
61-
== 10
62-
)
63-
64-
# Test over limit value
65-
assert (
66-
hook._get_split_pdf_call_threads(
67-
{
68-
"split_pdf_threads": "20",
69-
}
70-
)
71-
== MAX_THREADS
72-
)
73-
74-
# Test negative value
75-
assert (
76-
hook._get_split_pdf_call_threads(
77-
{
78-
"split_pdf_threads": -3,
79-
}
80-
)
81-
== DEFAULT_NUM_THREADS
82-
)
52+
assert hook._get_split_pdf_call_threads({"split_pdf_threads": 10}) == 10
53+
assert hook._get_split_pdf_call_threads({"split_pdf_threads": "20"}) == MAX_THREADS
54+
assert hook._get_split_pdf_call_threads({"split_pdf_threads": -3}) == DEFAULT_NUM_THREADS
8355

8456
def test_unit_prepare_request_payload(self):
8557
"""Test prepare request payload method properly sets split_pdf_page to 'false'

0 commit comments

Comments
 (0)