-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added pytests for config, api and dependency testing #56
Conversation
"/process-prompt", | ||
json={"user_prompt_text": "Test prompt"} | ||
) | ||
assert response.status_code == 200 |
Check notice
Code scanning / Bandit
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Note test
json={"user_prompt_text": "Test prompt"} | ||
) | ||
assert response.status_code == 200 | ||
assert "generated_response" in response.json() |
Check notice
Code scanning / Bandit
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Note test
"/process-prompt", | ||
json={"user_prompt_text": ""} | ||
) | ||
assert response.status_code == 422 |
Check notice
Code scanning / Bandit
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Note test
"/process-prompt", | ||
json={"user_prompt_text": "a" * 1001} | ||
) | ||
assert response.status_code == 422 |
Check notice
Code scanning / Bandit
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Note test
|
||
with patch.dict(os.environ, test_env_vars): | ||
processor = PromptProcessor() | ||
assert processor.OPENAI_API_KEY == 'test-openai-key' |
Check notice
Code scanning / Bandit
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Note test
|
||
context_segments, keywords = processor.search_weaviate("test query") | ||
assert isinstance(context_segments, list) | ||
assert isinstance(keywords, list) |
Check notice
Code scanning / Bandit
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Note test
json={"user_prompt_text": test_prompt} | ||
) | ||
|
||
assert response.status_code == 200 |
Check notice
Code scanning / Bandit
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Note test
) | ||
|
||
assert response.status_code == 200 | ||
assert "generated_response" in response.json() |
Check notice
Code scanning / Bandit
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Note test
|
||
assert response.status_code == 200 | ||
assert "generated_response" in response.json() | ||
assert "context_segments" in response.json() |
Check notice
Code scanning / Bandit
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Note test
assert response.status_code == 200 | ||
assert "generated_response" in response.json() | ||
assert "context_segments" in response.json() | ||
assert "keywords" in response.json() |
Check notice
Code scanning / Bandit
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Note test
Added running commands in tests/init.py