codemie-test-harness 0.1.209__py3-none-any.whl → 0.1.210__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of codemie-test-harness might be problematic. Click here for more details.
- codemie_test_harness/tests/swagger/__init__.py +0 -0
- codemie_test_harness/tests/swagger/test_swagger_endpoint.py +105 -0
- {codemie_test_harness-0.1.209.dist-info → codemie_test_harness-0.1.210.dist-info}/METADATA +2 -2
- {codemie_test_harness-0.1.209.dist-info → codemie_test_harness-0.1.210.dist-info}/RECORD +6 -4
- {codemie_test_harness-0.1.209.dist-info → codemie_test_harness-0.1.210.dist-info}/WHEEL +0 -0
- {codemie_test_harness-0.1.209.dist-info → codemie_test_harness-0.1.210.dist-info}/entry_points.txt +0 -0
|
File without changes
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"""
|
|
2
|
+
API tests for Swagger documentation endpoint.
|
|
3
|
+
|
|
4
|
+
This module tests the health and accessibility of the Swagger/OpenAPI documentation endpoint.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
import os
|
|
8
|
+
|
|
9
|
+
import pytest
|
|
10
|
+
import requests
|
|
11
|
+
from hamcrest import assert_that, equal_to, is_in, less_than
|
|
12
|
+
|
|
13
|
+
# Module-level constants
|
|
14
|
+
CODEMIE_API_DOMAIN = os.getenv("CODEMIE_API_DOMAIN")
|
|
15
|
+
SWAGGER_URL = f"{CODEMIE_API_DOMAIN}/docs"
|
|
16
|
+
OPENAPI_JSON_URL = f"{CODEMIE_API_DOMAIN}/openapi.json"
|
|
17
|
+
VERIFY_SSL = os.getenv("VERIFY_SSL", "True").lower() == "true"
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
@pytest.mark.api
|
|
21
|
+
@pytest.mark.smoke
|
|
22
|
+
def test_swagger_endpoint_is_accessible():
|
|
23
|
+
"""
|
|
24
|
+
Test that the Swagger documentation endpoint is accessible and returns a successful response.
|
|
25
|
+
|
|
26
|
+
The test verifies:
|
|
27
|
+
1. The endpoint responds with HTTP 200 status code
|
|
28
|
+
2. The endpoint is reachable and healthy
|
|
29
|
+
"""
|
|
30
|
+
response = requests.get(SWAGGER_URL, verify=VERIFY_SSL)
|
|
31
|
+
|
|
32
|
+
assert_that(response.status_code, equal_to(200))
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
@pytest.mark.api
|
|
36
|
+
@pytest.mark.smoke
|
|
37
|
+
def test_swagger_endpoint_returns_html():
|
|
38
|
+
"""
|
|
39
|
+
Test that the Swagger documentation endpoint returns HTML content.
|
|
40
|
+
|
|
41
|
+
The test verifies:
|
|
42
|
+
1. The response content type is HTML
|
|
43
|
+
2. The response contains expected Swagger/OpenAPI keywords
|
|
44
|
+
"""
|
|
45
|
+
|
|
46
|
+
response = requests.get(SWAGGER_URL, verify=VERIFY_SSL)
|
|
47
|
+
|
|
48
|
+
assert_that(response.status_code, equal_to(200))
|
|
49
|
+
|
|
50
|
+
content_type = response.headers.get("Content-Type", "")
|
|
51
|
+
assert_that("text/html", is_in(content_type))
|
|
52
|
+
|
|
53
|
+
# Verify the response contains Swagger/OpenAPI related content
|
|
54
|
+
content = response.text.lower()
|
|
55
|
+
keywords = ["swagger", "openapi", "api", "docs"]
|
|
56
|
+
assert_that(any(keyword in content for keyword in keywords), equal_to(True))
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
@pytest.mark.api
|
|
60
|
+
@pytest.mark.smoke
|
|
61
|
+
def test_swagger_endpoint_response_time():
|
|
62
|
+
"""
|
|
63
|
+
Test that the Swagger documentation endpoint responds within acceptable time.
|
|
64
|
+
|
|
65
|
+
The test verifies:
|
|
66
|
+
1. The endpoint responds within 5 seconds
|
|
67
|
+
"""
|
|
68
|
+
timeout = 5 # seconds
|
|
69
|
+
|
|
70
|
+
try:
|
|
71
|
+
response = requests.get(SWAGGER_URL, verify=VERIFY_SSL, timeout=timeout)
|
|
72
|
+
assert_that(response.status_code, equal_to(200))
|
|
73
|
+
assert_that(response.elapsed.total_seconds(), less_than(timeout))
|
|
74
|
+
except requests.exceptions.Timeout:
|
|
75
|
+
pytest.fail(f"Swagger endpoint did not respond within {timeout} seconds")
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
@pytest.mark.api
|
|
79
|
+
@pytest.mark.smoke
|
|
80
|
+
def test_openapi_json_endpoint(client):
|
|
81
|
+
"""
|
|
82
|
+
Test that the OpenAPI JSON endpoint returns valid JSON with expected metadata.
|
|
83
|
+
|
|
84
|
+
The test verifies:
|
|
85
|
+
1. The endpoint responds with HTTP 200 status code
|
|
86
|
+
2. The response is valid JSON
|
|
87
|
+
3. The info.title field equals "Codemie"
|
|
88
|
+
4. The info.description field equals "Smart AI assistant 'CodeMie'"
|
|
89
|
+
"""
|
|
90
|
+
headers = {"Authorization": f"Bearer {client.token}"}
|
|
91
|
+
response = requests.get(OPENAPI_JSON_URL, headers=headers, verify=VERIFY_SSL)
|
|
92
|
+
|
|
93
|
+
assert_that(response.status_code, equal_to(200))
|
|
94
|
+
|
|
95
|
+
# Verify response is valid JSON
|
|
96
|
+
openapi_spec = response.json()
|
|
97
|
+
|
|
98
|
+
# Verify info.title
|
|
99
|
+
assert_that(openapi_spec.get("info", {}).get("title"), equal_to("Codemie"))
|
|
100
|
+
|
|
101
|
+
# Verify info.description
|
|
102
|
+
assert_that(
|
|
103
|
+
openapi_spec.get("info", {}).get("description"),
|
|
104
|
+
equal_to("Smart AI assistant 'CodeMie'"),
|
|
105
|
+
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: codemie-test-harness
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.210
|
|
4
4
|
Summary: Autotest for CodeMie backend and UI
|
|
5
5
|
Author: Anton Yeromin
|
|
6
6
|
Author-email: anton_yeromin@epam.com
|
|
@@ -13,7 +13,7 @@ Requires-Dist: aws-assume-role-lib (>=2.10.0,<3.0.0)
|
|
|
13
13
|
Requires-Dist: boto3 (>=1.39.8,<2.0.0)
|
|
14
14
|
Requires-Dist: click (>=8.1.7,<9.0.0)
|
|
15
15
|
Requires-Dist: codemie-plugins (>=0.1.123,<0.2.0)
|
|
16
|
-
Requires-Dist: codemie-sdk-python (==0.1.
|
|
16
|
+
Requires-Dist: codemie-sdk-python (==0.1.210)
|
|
17
17
|
Requires-Dist: pytest (>=8.4.1,<9.0.0)
|
|
18
18
|
Requires-Dist: pytest-playwright (>=0.7.0,<0.8.0)
|
|
19
19
|
Requires-Dist: pytest-repeat (>=0.9.3,<0.10.0)
|
|
@@ -101,6 +101,8 @@ codemie_test_harness/tests/service/test_task_service.py,sha256=q2RaZbNooWraONLFC
|
|
|
101
101
|
codemie_test_harness/tests/service/test_user_service.py,sha256=NqSsxOLTGg7p7juHLFP6StEs2Qx_wfct9R7F83pe2JU,1135
|
|
102
102
|
codemie_test_harness/tests/service/test_workflow_execution_service.py,sha256=pHV7WXvQKzpw0wMn6aHVZ01g7yZupmU5NXLVE9rIKjo,5419
|
|
103
103
|
codemie_test_harness/tests/service/test_workflow_service.py,sha256=QyxtorhaCI1oE2D1OLx7X7jAlBv0kwwFpQztvV1nUus,8152
|
|
104
|
+
codemie_test_harness/tests/swagger/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
105
|
+
codemie_test_harness/tests/swagger/test_swagger_endpoint.py,sha256=rMfZD1HfCkZqxXKzeIH8MTAIMp8qkhAb2-UHrrt_Gn4,3244
|
|
104
106
|
codemie_test_harness/tests/test_data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
105
107
|
codemie_test_harness/tests/test_data/ado_test_plan_tools_test_data.py,sha256=Al5u4HNfrcoj-b072uEGsqUqjKqwXLGJXKQ0QeJT3PI,5778
|
|
106
108
|
codemie_test_harness/tests/test_data/ado_wiki_tools_test_data.py,sha256=xvgEja5vE0l41sP4fE0stdFLQ0M201FWynOCEcRYufE,3188
|
|
@@ -398,7 +400,7 @@ codemie_test_harness/tests/workflow/virtual_assistant_tools/servicenow/__init__.
|
|
|
398
400
|
codemie_test_harness/tests/workflow/virtual_assistant_tools/servicenow/test_workflow_with_servicenow_tools.py,sha256=D835gaRbCnB4va5mi9TdA_u9StSpGXQ_fgzwW0S2pwo,1173
|
|
399
401
|
codemie_test_harness/tests/workflow/virtual_assistant_tools/vcs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
400
402
|
codemie_test_harness/tests/workflow/virtual_assistant_tools/vcs/test_workflow_with_vcs_tools.py,sha256=Se9imIiBYuJU78m1pLu0g4ZmHygKZjr6JjIWkGXTy1Q,1364
|
|
401
|
-
codemie_test_harness-0.1.
|
|
402
|
-
codemie_test_harness-0.1.
|
|
403
|
-
codemie_test_harness-0.1.
|
|
404
|
-
codemie_test_harness-0.1.
|
|
403
|
+
codemie_test_harness-0.1.210.dist-info/METADATA,sha256=31wxZU4HEtBcQXMDenu3M_VQUjMt54iv0koJLupa054,27184
|
|
404
|
+
codemie_test_harness-0.1.210.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
|
|
405
|
+
codemie_test_harness-0.1.210.dist-info/entry_points.txt,sha256=n98t-EOM5M1mnMl_j2X4siyeO9zr0WD9a5LF7JyElIM,73
|
|
406
|
+
codemie_test_harness-0.1.210.dist-info/RECORD,,
|
|
File without changes
|
{codemie_test_harness-0.1.209.dist-info → codemie_test_harness-0.1.210.dist-info}/entry_points.txt
RENAMED
|
File without changes
|