-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_output.txt
More file actions
169 lines (163 loc) · 24.4 KB
/
Copy pathtest_output.txt
File metadata and controls
169 lines (163 loc) · 24.4 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
{"timestamp": "2025-12-15T06:37:46.577469+00:00", "level": "INFO", "logger": "buja.config.database", "message": "Database engine initialized (SQLite)", "module": "database", "function": "__init__", "line": 103}
============================= test session starts =============================
platform win32 -- Python 3.11.14, pytest-9.0.1, pluggy-1.6.0 -- F:\git_projects\BUJA\.venv\Scripts\python.exe
cachedir: .pytest_cache
rootdir: F:\git_projects\BUJA
configfile: pytest.ini
plugins: anyio-4.11.0, asyncio-1.3.0, cov-7.0.0, mock-3.15.1
asyncio: mode=Mode.AUTO, debug=False, asyncio_default_fixture_loop_scope=None, asyncio_default_test_loop_scope=function
collecting ... collected 10 items
tests/unit/test_llm_client.py::TestRateLimiter::test_rate_limiter_acquire PASSED
tests/unit/test_llm_client.py::TestOpenAIProvider::test_init_without_api_key PASSED
tests/unit/test_llm_client.py::TestOpenAIProvider::test_generate_text_success DEBUG: result={'content': 'Generated text', 'tool_calls': []}
DEBUG: create calls=1
FAILED
tests/unit/test_llm_client.py::TestOpenAIProvider::test_generate_text_api_error {"timestamp": "2025-12-15T06:37:48.268611+00:00", "level": "ERROR", "logger": "buja.src.external.llm_client", "message": "OpenAI API error: API Error", "module": "llm_client", "function": "generate_text", "line": 283}
{"timestamp": "2025-12-15T06:37:48.268611+00:00", "level": "WARNING", "logger": "buja.src.external.llm_client", "message": "LLM API call failed (attempt 1/4), retrying in 1.0s: OpenAI API call failed: API Error", "module": "llm_client", "function": "wrapper", "line": 49}
{"timestamp": "2025-12-15T06:37:49.283181+00:00", "level": "ERROR", "logger": "buja.src.external.llm_client", "message": "OpenAI API error: API Error", "module": "llm_client", "function": "generate_text", "line": 283}
{"timestamp": "2025-12-15T06:37:49.283686+00:00", "level": "WARNING", "logger": "buja.src.external.llm_client", "message": "LLM API call failed (attempt 2/4), retrying in 2.0s: OpenAI API call failed: API Error", "module": "llm_client", "function": "wrapper", "line": 49}
{"timestamp": "2025-12-15T06:37:51.286737+00:00", "level": "ERROR", "logger": "buja.src.external.llm_client", "message": "OpenAI API error: API Error", "module": "llm_client", "function": "generate_text", "line": 283}
{"timestamp": "2025-12-15T06:37:51.287242+00:00", "level": "WARNING", "logger": "buja.src.external.llm_client", "message": "LLM API call failed (attempt 3/4), retrying in 4.0s: OpenAI API call failed: API Error", "module": "llm_client", "function": "wrapper", "line": 49}
{"timestamp": "2025-12-15T06:37:55.288301+00:00", "level": "ERROR", "logger": "buja.src.external.llm_client", "message": "OpenAI API error: API Error", "module": "llm_client", "function": "generate_text", "line": 283}
{"timestamp": "2025-12-15T06:37:55.288301+00:00", "level": "ERROR", "logger": "buja.src.external.llm_client", "message": "LLM API call failed after 4 attempts: OpenAI API call failed: API Error", "module": "llm_client", "function": "wrapper", "line": 55}
PASSED
tests/unit/test_llm_client.py::TestAnthropicProvider::test_init_without_api_key PASSED
tests/unit/test_llm_client.py::TestAnthropicProvider::test_generate_text_success PASSED
tests/unit/test_llm_client.py::TestLLMClient::test_register_provider {"timestamp": "2025-12-15T06:37:55.321039+00:00", "level": "INFO", "logger": "buja.src.external.llm_client", "message": "LLM Provider registered: openai", "module": "llm_client", "function": "register_provider", "line": 512}
PASSED
tests/unit/test_llm_client.py::TestLLMClient::test_get_provider_success {"timestamp": "2025-12-15T06:37:55.333176+00:00", "level": "INFO", "logger": "buja.src.external.llm_client", "message": "LLM Provider registered: openai", "module": "llm_client", "function": "register_provider", "line": 512}
PASSED
tests/unit/test_llm_client.py::TestLLMClient::test_get_provider_not_found PASSED
tests/unit/test_llm_client.py::TestLLMClient::test_generate_text {"timestamp": "2025-12-15T06:37:55.346574+00:00", "level": "INFO", "logger": "buja.src.external.llm_client", "message": "LLM Provider registered: openai", "module": "llm_client", "function": "register_provider", "line": 512}
FAILED
ERROR: Coverage failure: total of 5 is less than fail-under=80
================================== FAILURES ===================================
________________ TestOpenAIProvider.test_generate_text_success ________________
tests\unit\test_llm_client.py:67: in test_generate_text_success
assert result == "Generated text"
E AssertionError: assert {'content': 'Generated text', 'tool_calls': []} == 'Generated text'
______________________ TestLLMClient.test_generate_text _______________________
C:\Users\hawks\AppData\Roaming\uv\python\cpython-3.11.14-windows-x86_64-none\Lib\unittest\mock.py:939: in assert_called_with
raise AssertionError(_error_message()) from cause
E AssertionError: expected call not found.
E Expected: mock('Test prompt', provider_name=None)
E Actual: mock('Test prompt')
During handling of the above exception, another exception occurred:
C:\Users\hawks\AppData\Roaming\uv\python\cpython-3.11.14-windows-x86_64-none\Lib\unittest\mock.py:951: in assert_called_once_with
return self.assert_called_with(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E AssertionError: expected call not found.
E Expected: mock('Test prompt', provider_name=None)
E Actual: mock('Test prompt')
E
E pytest introspection follows:
E
E Kwargs:
E assert {} == {'provider_name': None}
E
E Right contains 1 more item:
E {'provider_name': None}
E
E Full diff:
E + {}
E - {
E - 'provider_name': None,
E - }
During handling of the above exception, another exception occurred:
tests\unit\test_llm_client.py:156: in test_generate_text
provider.generate_text.assert_called_once_with("Test prompt", provider_name=None)
E AssertionError: expected call not found.
E Expected: mock('Test prompt', provider_name=None)
E Actual: mock('Test prompt')
E
E pytest introspection follows:
E
E Kwargs:
E assert {} == {'provider_name': None}
E
E Right contains 1 more item:
E {'provider_name': None}
E
E Full diff:
E + {}
E - {
E - 'provider_name': None,
E - }
------------------------------ Captured log call ------------------------------
INFO buja.src.external.llm_client:llm_client.py:512 LLM Provider registered: openai
=============================== tests coverage ================================
______________ coverage: platform win32, python 3.11.14-final-0 _______________
Name Stmts Miss Cover Missing
-----------------------------------------------------------------------------
src\__init__.py 0 0 100%
src\agents\__init__.py 4 4 0% 4-8
src\agents\autonomous_investment_agent.py 32 32 0% 4-124
src\agents\base_agent.py 48 48 0% 4-142
src\agents\investment_agent.py 226 226 0% 4-579
src\agents\tools\__init__.py 6 6 0% 4-10
src\agents\tools\base_tool.py 16 16 0% 4-63
src\agents\tools\mcp_tool.py 37 37 0% 4-111
src\agents\tools\portfolio_analysis_tool.py 28 28 0% 4-85
src\agents\tools\recommendation_tool.py 19 19 0% 4-72
src\agents\tools\risk_calculator_tool.py 21 21 0% 4-66
src\analyzers\__init__.py 5 5 0% 4-9
src\analyzers\asset_allocator.py 72 72 0% 4-311
src\analyzers\performance_analyzer.py 62 62 0% 4-180
src\analyzers\portfolio_analyzer.py 59 59 0% 4-154
src\analyzers\risk_analyzer.py 114 114 0% 4-295
src\exceptions.py 44 0 100%
src\external\__init__.py 2 0 100%
src\external\llm_client.py 238 116 51% 57-58, 120-121, 163, 187, 211, 239, 252-254, 281, 296-317, 329-366, 400-402, 414-429, 441-484, 529, 573-575, 598-599, 618-630, 647-696
src\middleware\__init__.py 3 3 0% 4-7
src\middleware\auth_middleware.py 89 89 0% 4-183
src\middleware\error_handler.py 48 48 0% 4-120
src\models\__init__.py 9 9 0% 4-18
src\models\base.py 8 8 0% 4-23
src\models\chat.py 17 17 0% 4-42
src\models\chat_project.py 17 17 0% 4-43
src\models\financial.py 32 32 0% 4-65
src\models\investment.py 42 42 0% 4-76
src\models\notification.py 30 30 0% 4-66
src\models\portfolio.py 66 66 0% 4-162
src\models\user.py 33 33 0% 4-117
src\repositories\__init__.py 8 8 0% 4-25
src\repositories\base_repository.py 60 60 0% 4-124
src\repositories\chat_project_repository.py 68 68 0% 4-137
src\repositories\chat_repository.py 55 55 0% 4-110
src\repositories\investment_repository.py 77 77 0% 4-300
src\repositories\notification_repository.py 39 39 0% 4-77
src\repositories\portfolio_repository.py 79 79 0% 4-286
src\repositories\user_repository.py 51 51 0% 4-122
src\services\__init__.py 14 14 0% 4-18
src\services\chat_project_service.py 31 31 0% 4-93
src\services\chat_service.py 135 135 0% 4-303
src\services\currency_hedge_service.py 61 61 0% 4-209
src\services\email_notification_service.py 57 57 0% 4-201
src\services\goal_tracking_service.py 95 95 0% 4-230
src\services\investment_preference_service.py 86 86 0% 4-265
src\services\investment_service.py 101 101 0% 4-276
src\services\mcp_tool_service.py 62 62 0% 4-147
src\services\notification_service.py 48 48 0% 4-147
src\services\portfolio_monitoring_service.py 129 129 0% 4-303
src\services\portfolio_service.py 68 68 0% 4-248
src\services\recommendation_service.py 75 75 0% 4-226
src\services\scheduler_service.py 70 70 0% 4-111
src\services\screenshot_service.py 105 105 0% 4-294
src\services\user_service.py 161 161 0% 4-456
src\utils\__init__.py 5 5 0% 4-9
src\utils\async_helpers.py 11 11 0% 4-29
src\utils\chat_ui.py 5 5 0% 4-90
src\utils\converters.py 9 9 0% 4-52
src\utils\formatters.py 10 10 0% 6-50
src\utils\security.py 14 14 0% 4-45
src\utils\sidebar.py 338 338 0% 5-1841
src\utils\validators.py 28 28 0% 4-100
-----------------------------------------------------------------------------
TOTAL 3582 3414 5%
Coverage HTML written to dir htmlcov
Coverage XML written to file coverage.xml
FAIL Required test coverage of 80% not reached. Total coverage: 4.69%
=========================== short test summary info ===========================
FAILED tests/unit/test_llm_client.py::TestOpenAIProvider::test_generate_text_success
FAILED tests/unit/test_llm_client.py::TestLLMClient::test_generate_text - Ass...
========================= 2 failed, 8 passed in 9.94s =========================