specmatic 1.3.25__py3-none-any.whl → 1.3.29__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 specmatic might be problematic. Click here for more details.
- specmatic/core/specmatic.jar +0 -0
- specmatic/coverage/sanic_app_route_adapter.py +2 -2
- specmatic/generators/pytest_generator.py +4 -4
- specmatic/generators/test_generator_base.py +25 -11
- specmatic/generators/unittest_generator.py +4 -4
- specmatic/version.py +2 -2
- {specmatic-1.3.25.dist-info → specmatic-1.3.29.dist-info}/METADATA +1 -1
- {specmatic-1.3.25.dist-info → specmatic-1.3.29.dist-info}/RECORD +10 -10
- {specmatic-1.3.25.dist-info → specmatic-1.3.29.dist-info}/WHEEL +1 -1
- {specmatic-1.3.25.dist-info → specmatic-1.3.29.dist-info}/top_level.txt +0 -0
specmatic/core/specmatic.jar
CHANGED
|
Binary file
|
|
@@ -15,5 +15,5 @@ class SanicAppRouteAdapter(AppRouteAdapter):
|
|
|
15
15
|
return self.routes_as_list()
|
|
16
16
|
|
|
17
17
|
def convert_to_spring_actuator_url_format(self, flask_route_url):
|
|
18
|
-
pattern = r
|
|
19
|
-
return re.sub(pattern, r
|
|
18
|
+
pattern = r"<(\w+):([^\/]+)>"
|
|
19
|
+
return re.sub(pattern, r"{\1}", flask_route_url)
|
|
@@ -15,14 +15,14 @@ class PyTestGenerator(TestGeneratorBase):
|
|
|
15
15
|
|
|
16
16
|
@staticmethod
|
|
17
17
|
def _generate_passing_test():
|
|
18
|
-
def
|
|
18
|
+
def test_pass(self):
|
|
19
19
|
assert 1 == 1
|
|
20
20
|
|
|
21
|
-
return
|
|
21
|
+
return test_pass
|
|
22
22
|
|
|
23
23
|
@staticmethod
|
|
24
24
|
def _generate_failing_test(error):
|
|
25
|
-
def
|
|
25
|
+
def test_fail(self):
|
|
26
26
|
pytest.fail(error)
|
|
27
27
|
|
|
28
|
-
return
|
|
28
|
+
return test_fail
|
|
@@ -1,15 +1,29 @@
|
|
|
1
|
+
import re
|
|
1
2
|
import xml.etree.ElementTree as ET
|
|
2
|
-
|
|
3
|
+
from typing import Callable, Type
|
|
3
4
|
|
|
4
5
|
class TestGeneratorBase:
|
|
6
|
+
pattern = re.compile(r"[\s\S]*dynamic-test:#(\d+)[\s\S]*")
|
|
5
7
|
@staticmethod
|
|
6
|
-
def generate_tests(junit_report_path, test_class, passing_test_fn, failing_test_fn):
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
def generate_tests(junit_report_path: str, test_class: Type, passing_test_fn: Callable, failing_test_fn: Callable) -> None:
|
|
9
|
+
test_cases = []
|
|
10
|
+
|
|
11
|
+
try:
|
|
12
|
+
root = ET.parse(junit_report_path).getroot()
|
|
13
|
+
for testcase in root.iter('testcase'):
|
|
14
|
+
test_case_info = re.match(TestGeneratorBase.pattern, testcase.find('system-out').text) # type: ignore
|
|
15
|
+
if test_case_info is None:
|
|
16
|
+
raise ValueError("Invalid test case information")
|
|
17
|
+
unique_id = test_case_info.groups()[0]
|
|
18
|
+
test_name = f"test [{unique_id}] {testcase.get("name")}"
|
|
19
|
+
failure_message = testcase.findtext('failure')
|
|
20
|
+
if failure_message is None:
|
|
21
|
+
test_cases.append((unique_id, test_name, passing_test_fn()))
|
|
22
|
+
else:
|
|
23
|
+
test_cases.append((unique_id, test_name, failing_test_fn(failure_message)))
|
|
24
|
+
except ET.ParseError as e:
|
|
25
|
+
raise ValueError("Invalid XML file") from e
|
|
26
|
+
|
|
27
|
+
test_cases.sort(key=lambda testcase : int(testcase[0]))
|
|
28
|
+
for (unique_id, test_name, test_fn) in test_cases:
|
|
29
|
+
setattr(test_class, test_name, test_fn)
|
|
@@ -9,17 +9,17 @@ class UnitTestGenerator(TestGeneratorBase):
|
|
|
9
9
|
|
|
10
10
|
@staticmethod
|
|
11
11
|
def _gen_passing_test():
|
|
12
|
-
def
|
|
12
|
+
def test_pass(self):
|
|
13
13
|
self.assertTrue(1 == 1)
|
|
14
14
|
|
|
15
|
-
return
|
|
15
|
+
return test_pass
|
|
16
16
|
|
|
17
17
|
@staticmethod
|
|
18
18
|
def _gen_failing_test(error):
|
|
19
|
-
def
|
|
19
|
+
def test_fail(self):
|
|
20
20
|
self.fail(error)
|
|
21
21
|
|
|
22
|
-
return
|
|
22
|
+
return test_fail
|
|
23
23
|
|
|
24
24
|
def generate(self):
|
|
25
25
|
self.generate_tests(self.junit_report_path, self.test_class, UnitTestGenerator._gen_passing_test,
|
specmatic/version.py
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
__version__ = '1.3.
|
|
2
|
-
__specmatic_version__ = '1.3.
|
|
1
|
+
__version__ = '1.3.29'
|
|
2
|
+
__specmatic_version__ = '1.3.29'
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
specmatic/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
2
|
specmatic/build_utils.py,sha256=ukvyMkk8kkUqZiR6zQrxZbafKMByiVLzASSbypMsDp4,564
|
|
3
3
|
specmatic/utils.py,sha256=6JDPqpO51ykl0MWCOa32jkUOXZ-0RZ6N5Ng9_7r7XaU,519
|
|
4
|
-
specmatic/version.py,sha256=
|
|
4
|
+
specmatic/version.py,sha256=Jy7mumOtc513LBT2T6luSw5r-K-QSgoUH9QUEd03OM8,56
|
|
5
5
|
specmatic/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
6
|
specmatic/core/decorators.py,sha256=E2U8ewezMYz8TpOF44qtdL1ahPa5F_HXU0nZ9uSbS1Q,3944
|
|
7
|
-
specmatic/core/specmatic.jar,sha256=
|
|
7
|
+
specmatic/core/specmatic.jar,sha256=p-AFV49L1KI81VNbofXhFtFd1o1Q2N6SjNbXZx-eyn8,65936740
|
|
8
8
|
specmatic/core/specmatic.py,sha256=OkQy_rwhy9EQaUcB4L6Al_AtEDfwpTqwqZJccfpIKU4,7904
|
|
9
9
|
specmatic/core/specmatic_base.py,sha256=NKFjJBB4edxinA8fgfd5aNOwJjD9xu7KpeeSsumoUTs,1735
|
|
10
10
|
specmatic/core/specmatic_stub.py,sha256=_I6jc8oI7me6Q64gtPchRRqA-c8GGO5YTCIpw1nrwEo,4563
|
|
@@ -14,22 +14,22 @@ specmatic/coverage/app_route_adapter.py,sha256=hFJ54R7CZFK9jFI6VbxHtKJKJgLX4PUX4
|
|
|
14
14
|
specmatic/coverage/coverage_route.py,sha256=WaqjG2Oh2PUfP72HoRnPkb5jG4BUmZK7Acla7gt_5Ko,284
|
|
15
15
|
specmatic/coverage/fastapi_app_route_adapter.py,sha256=ziPbCCx6Mw2jxKis4Z9yd-jKNHmVKgAAVbIwFfAc3JA,869
|
|
16
16
|
specmatic/coverage/flask_app_route_adapter.py,sha256=1OQXiqG3VCBwKpG5PGkjTHv27dnKjyy_spGhtg2omkE,897
|
|
17
|
-
specmatic/coverage/sanic_app_route_adapter.py,sha256=
|
|
17
|
+
specmatic/coverage/sanic_app_route_adapter.py,sha256=zvwvV_bpSigc86hmKnMXGYWMbuXFz2DxyfOHXkXff18,761
|
|
18
18
|
specmatic/coverage/servers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
19
19
|
specmatic/coverage/servers/coverage_server.py,sha256=WaicRYG3LICiKmVg_TJlmuAS0espGLH9jWI6RsU6FPQ,2035
|
|
20
20
|
specmatic/coverage/servers/fastapi_app_coverage_server.py,sha256=JwZcvDZrrwam6i875qMwWxIRI99Q0nXsXNEH2oNhCfk,283
|
|
21
21
|
specmatic/coverage/servers/flask_app_coverage_server.py,sha256=JvswIhMaOXI7ab08Xd13T1x4p7vY2J9b2oe4MuJyC_k,275
|
|
22
22
|
specmatic/coverage/servers/sanic_app_coverage_server.py,sha256=VoIxxGX8a2NPKJRkt6pfydxmw6TrV_r6lfAr94ekSdQ,275
|
|
23
23
|
specmatic/generators/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
24
|
-
specmatic/generators/pytest_generator.py,sha256=
|
|
25
|
-
specmatic/generators/test_generator_base.py,sha256=
|
|
26
|
-
specmatic/generators/unittest_generator.py,sha256=
|
|
24
|
+
specmatic/generators/pytest_generator.py,sha256=jUvZ9BRJp_UFIphGT9PdgDRkzNd6bYmKMWlLZeB6d_Q,755
|
|
25
|
+
specmatic/generators/test_generator_base.py,sha256=X7pHFGVtUqweSrUqgE5EYX5pFMoJvOs3vxX-gVtykUo,1400
|
|
26
|
+
specmatic/generators/unittest_generator.py,sha256=jrWg_IIEcF7TA-D35XsTsdSbGpf6WUIlGoqHABQqNRw,733
|
|
27
27
|
specmatic/servers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
28
28
|
specmatic/servers/app_server.py,sha256=kOZviJA7-F4kmMTLGiBln2oO5uYX28wKJM2xQJTOVQY,456
|
|
29
29
|
specmatic/servers/asgi_app_server.py,sha256=yn3tpWoF-nP8labOJdn49UB85vKiqIELVXk-gAugcUc,2924
|
|
30
30
|
specmatic/servers/wsgi_app_server.py,sha256=3aU-o6Hh8FrnZlbjCLLpGY92HvJoU_rcqsZIb9TKVr8,1342
|
|
31
31
|
specmatic/servers/wsgi_server_thread.py,sha256=XUEYW7-FP1a-5EkQVGc3FI_jkDQBocArxHLiCn3JJvc,691
|
|
32
|
-
specmatic-1.3.
|
|
33
|
-
specmatic-1.3.
|
|
34
|
-
specmatic-1.3.
|
|
35
|
-
specmatic-1.3.
|
|
32
|
+
specmatic-1.3.29.dist-info/METADATA,sha256=npvsqaYEnqIL2y2NAU0HvRtxKbW0mgp4KDdq-zmkqNM,10355
|
|
33
|
+
specmatic-1.3.29.dist-info/WHEEL,sha256=cpQTJ5IWu9CdaPViMhC9YzF8gZuS5-vlfoFihTBC86A,91
|
|
34
|
+
specmatic-1.3.29.dist-info/top_level.txt,sha256=E7kQ78YacKBoKKeKWR_N83exlG8r5J0wlzlGqFmvIfo,10
|
|
35
|
+
specmatic-1.3.29.dist-info/RECORD,,
|
|
File without changes
|