-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathunit_test_results.txt
61 lines (52 loc) · 3.69 KB
/
unit_test_results.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
(NLPtest) C:\Users\ssen\Documents\syenah\nlp-microservice-trojkn>pytest
=================================================== test session starts ====================================================
platform win32 -- Python 3.12.5, pytest-8.3.2, pluggy-1.5.0
rootdir: C:\Users\ssen\Documents\syenah\nlp-microservice-trojkn
plugins: anyio-4.4.0
collected 4 items
test_main.py .F.. [100%]
========================================================= FAILURES =========================================================
__________________________________________ test_summarize_article_invalid_payload __________________________________________
def test_summarize_article_invalid_payload():
# Define an invalid request payload
invalid_payload = {
"uri": "test-uri",
"title": "test-title",
"body": "", # Invalid because body should not be empty
"publication_datetime": "2024-08-15T14:01:03+00:00",
"lang": "en",
"url": "http://example.com",
"source": {
"domain": "example.com",
"location": {
"country": "TestCountry",
"state": "TestState",
"city": "TestCity",
"coordinates": {
"lat": 0.0,
"lon": 0.0
}
}
}
}
# Send a POST request to the /summarize_article endpoint
response = client.post("/summarize_article", json=invalid_payload)
# Assert the status code and response
> assert response.status_code == 422 # Unprocessable Entity
E assert 200 == 422
E + where 200 = <Response [200 OK]>.status_code
test_main.py:69: AssertionError
--------------------------------------------------- Captured stderr call ---------------------------------------------------
Your max_length is set to 130, but your input_length is only 3. Since this is a summarization task, where outputs shorter than the input are typically wanted, you might consider decreasing max_length manually, e.g. summarizer('...', max_length=1)
===================================================== warnings summary =====================================================
<frozen importlib._bootstrap>:488
<frozen importlib._bootstrap>:488: DeprecationWarning: Type google._upb._message.MessageMapContainer uses PyType_Spec with a metaclass that has custom tp_new. This is deprecated and will no longer be allowed in Python 3.14.
<frozen importlib._bootstrap>:488
<frozen importlib._bootstrap>:488: DeprecationWarning: Type google._upb._message.ScalarMapContainer uses PyType_Spec with a metaclass that has custom tp_new. This is deprecated and will no longer be allowed in Python 3.14.
NLPtest\Lib\site-packages\transformers\tokenization_utils_base.py:1601
C:\Users\ssen\Documents\syenah\nlp-microservice-trojkn\NLPtest\Lib\site-packages\transformers\tokenization_utils_base.py:1601: FutureWarning: `clean_up_tokenization_spaces` was not set. It will be set to `True` by default. This behavior will be depracted in transformers v4.45, and will be then set to `False` by default. For more details check this issue: https://github.com/huggingface/transformers/issues/31884
warnings.warn(
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
================================================= short test summary info ==================================================
FAILED test_main.py::test_summarize_article_invalid_payload - assert 200 == 422
=================================== 1 failed, 3 passed, 3 warnings in 208.85s (0:03:28) =