specmatic 2.7.2__tar.gz → 2.9.0__tar.gz

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.

Files changed (42) hide show
  1. {specmatic-2.7.2/specmatic.egg-info → specmatic-2.9.0}/PKG-INFO +1 -1
  2. {specmatic-2.7.2 → specmatic-2.9.0}/specmatic/core/specmatic.jar +0 -0
  3. {specmatic-2.7.2 → specmatic-2.9.0}/specmatic/core/specmatic_stub.py +19 -1
  4. specmatic-2.9.0/specmatic/version.py +2 -0
  5. {specmatic-2.7.2 → specmatic-2.9.0/specmatic.egg-info}/PKG-INFO +1 -1
  6. specmatic-2.7.2/specmatic/version.py +0 -2
  7. {specmatic-2.7.2 → specmatic-2.9.0}/MANIFEST.in +0 -0
  8. {specmatic-2.7.2 → specmatic-2.9.0}/README.md +0 -0
  9. {specmatic-2.7.2 → specmatic-2.9.0}/setup.cfg +0 -0
  10. {specmatic-2.7.2 → specmatic-2.9.0}/setup.py +0 -0
  11. {specmatic-2.7.2 → specmatic-2.9.0}/specmatic/__init__.py +0 -0
  12. {specmatic-2.7.2 → specmatic-2.9.0}/specmatic/build_utils.py +0 -0
  13. {specmatic-2.7.2 → specmatic-2.9.0}/specmatic/core/__init__.py +0 -0
  14. {specmatic-2.7.2 → specmatic-2.9.0}/specmatic/core/decorators.py +0 -0
  15. {specmatic-2.7.2 → specmatic-2.9.0}/specmatic/core/specmatic.py +0 -0
  16. {specmatic-2.7.2 → specmatic-2.9.0}/specmatic/core/specmatic_base.py +0 -0
  17. {specmatic-2.7.2 → specmatic-2.9.0}/specmatic/core/specmatic_test.py +0 -0
  18. {specmatic-2.7.2 → specmatic-2.9.0}/specmatic/coverage/__init__.py +0 -0
  19. {specmatic-2.7.2 → specmatic-2.9.0}/specmatic/coverage/app_route_adapter.py +0 -0
  20. {specmatic-2.7.2 → specmatic-2.9.0}/specmatic/coverage/coverage_route.py +0 -0
  21. {specmatic-2.7.2 → specmatic-2.9.0}/specmatic/coverage/fastapi_app_route_adapter.py +0 -0
  22. {specmatic-2.7.2 → specmatic-2.9.0}/specmatic/coverage/flask_app_route_adapter.py +0 -0
  23. {specmatic-2.7.2 → specmatic-2.9.0}/specmatic/coverage/sanic_app_route_adapter.py +0 -0
  24. {specmatic-2.7.2 → specmatic-2.9.0}/specmatic/coverage/servers/__init__.py +0 -0
  25. {specmatic-2.7.2 → specmatic-2.9.0}/specmatic/coverage/servers/coverage_server.py +0 -0
  26. {specmatic-2.7.2 → specmatic-2.9.0}/specmatic/coverage/servers/fastapi_app_coverage_server.py +0 -0
  27. {specmatic-2.7.2 → specmatic-2.9.0}/specmatic/coverage/servers/flask_app_coverage_server.py +0 -0
  28. {specmatic-2.7.2 → specmatic-2.9.0}/specmatic/coverage/servers/sanic_app_coverage_server.py +0 -0
  29. {specmatic-2.7.2 → specmatic-2.9.0}/specmatic/generators/__init__.py +0 -0
  30. {specmatic-2.7.2 → specmatic-2.9.0}/specmatic/generators/pytest_generator.py +0 -0
  31. {specmatic-2.7.2 → specmatic-2.9.0}/specmatic/generators/test_generator_base.py +0 -0
  32. {specmatic-2.7.2 → specmatic-2.9.0}/specmatic/generators/unittest_generator.py +0 -0
  33. {specmatic-2.7.2 → specmatic-2.9.0}/specmatic/servers/__init__.py +0 -0
  34. {specmatic-2.7.2 → specmatic-2.9.0}/specmatic/servers/app_server.py +0 -0
  35. {specmatic-2.7.2 → specmatic-2.9.0}/specmatic/servers/asgi_app_server.py +0 -0
  36. {specmatic-2.7.2 → specmatic-2.9.0}/specmatic/servers/wsgi_app_server.py +0 -0
  37. {specmatic-2.7.2 → specmatic-2.9.0}/specmatic/servers/wsgi_server_thread.py +0 -0
  38. {specmatic-2.7.2 → specmatic-2.9.0}/specmatic/utils.py +0 -0
  39. {specmatic-2.7.2 → specmatic-2.9.0}/specmatic.egg-info/SOURCES.txt +0 -0
  40. {specmatic-2.7.2 → specmatic-2.9.0}/specmatic.egg-info/dependency_links.txt +0 -0
  41. {specmatic-2.7.2 → specmatic-2.9.0}/specmatic.egg-info/requires.txt +0 -0
  42. {specmatic-2.7.2 → specmatic-2.9.0}/specmatic.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: specmatic
3
- Version: 2.7.2
3
+ Version: 2.9.0
4
4
  Summary: A Python module for using the Specmatic Library.
5
5
  Home-page: https://github.com/znsio/specmatic-python-extensions
6
6
  Author: Specmatic Builders
@@ -4,6 +4,7 @@ import subprocess
4
4
  import threading
5
5
  import traceback
6
6
  from queue import Queue
7
+ from urllib.parse import urlparse
7
8
 
8
9
  import requests
9
10
 
@@ -94,7 +95,7 @@ class SpecmaticStub(SpecmaticBase):
94
95
 
95
96
  if self.__stub_serving_message in line:
96
97
  if self.port == 0:
97
- self.port = line.split(self.__stub_serving_message)[0].split(":")[-1].strip()
98
+ self.port = self._extract_port(line.split(self.__stub_serving_message)[0])
98
99
  self.__stub_started_event.set()
99
100
 
100
101
  def read_and_print_output_line_by_line():
@@ -111,6 +112,23 @@ class SpecmaticStub(SpecmaticBase):
111
112
  self.__error_queue.put(tb)
112
113
  self.__stub_started_event.set()
113
114
 
115
+ @staticmethod
116
+ def _extract_port(text: str) -> str:
117
+ for token in text.split():
118
+ try:
119
+ parsed = urlparse(token)
120
+ if not parsed.hostname:
121
+ continue
122
+
123
+ implicit_port = { "http": 80,"https": 443 }.get(parsed.scheme, None)
124
+ port = parsed.port if parsed.port not in (None, -1) else implicit_port
125
+ if port is not None:
126
+ return str(port)
127
+ except ValueError:
128
+ continue
129
+
130
+ raise Exception(f"Unable to extract port from: {text}")
131
+
114
132
  def __read_process_error_output(self):
115
133
  try:
116
134
  for line in iter(self.__process.stderr.readline, ''):
@@ -0,0 +1,2 @@
1
+ __version__ = '2.9.0'
2
+ __specmatic_version__ = '2.9.0'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: specmatic
3
- Version: 2.7.2
3
+ Version: 2.9.0
4
4
  Summary: A Python module for using the Specmatic Library.
5
5
  Home-page: https://github.com/znsio/specmatic-python-extensions
6
6
  Author: Specmatic Builders
@@ -1,2 +0,0 @@
1
- __version__ = '2.7.2'
2
- __specmatic_version__ = '2.7.2'
File without changes
File without changes
File without changes
File without changes
File without changes