dothttp-req 0.0.44a28__tar.gz → 0.0.44a30__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.
Files changed (53) hide show
  1. {dothttp_req-0.0.44a28 → dothttp_req-0.0.44a30}/PKG-INFO +3 -5
  2. {dothttp_req-0.0.44a28 → dothttp_req-0.0.44a30}/dothttp/http.tx +1 -1
  3. {dothttp_req-0.0.44a28 → dothttp_req-0.0.44a30}/dothttp/models/computed.py +1 -1
  4. {dothttp_req-0.0.44a28 → dothttp_req-0.0.44a30}/dothttp/models/parse_models.py +1 -6
  5. {dothttp_req-0.0.44a28 → dothttp_req-0.0.44a30}/dothttp/parse/__init__.py +2 -7
  6. {dothttp_req-0.0.44a28 → dothttp_req-0.0.44a30}/dothttp/script/js3py.py +0 -54
  7. {dothttp_req-0.0.44a28 → dothttp_req-0.0.44a30}/pyproject.toml +8 -9
  8. {dothttp_req-0.0.44a28 → dothttp_req-0.0.44a30}/LICENSE.txt +0 -0
  9. {dothttp_req-0.0.44a28 → dothttp_req-0.0.44a30}/README.md +0 -0
  10. {dothttp_req-0.0.44a28 → dothttp_req-0.0.44a30}/dotextensions/__init__.py +0 -0
  11. {dothttp_req-0.0.44a28 → dothttp_req-0.0.44a30}/dotextensions/server/__init__.py +0 -0
  12. {dothttp_req-0.0.44a28 → dothttp_req-0.0.44a30}/dotextensions/server/__main__.py +0 -0
  13. {dothttp_req-0.0.44a28 → dothttp_req-0.0.44a30}/dotextensions/server/agent.py +0 -0
  14. {dothttp_req-0.0.44a28 → dothttp_req-0.0.44a30}/dotextensions/server/handlers/__init__.py +0 -0
  15. {dothttp_req-0.0.44a28 → dothttp_req-0.0.44a30}/dotextensions/server/handlers/basic_handlers.py +0 -0
  16. {dothttp_req-0.0.44a28 → dothttp_req-0.0.44a30}/dotextensions/server/handlers/fs_handlers.py +0 -0
  17. {dothttp_req-0.0.44a28 → dothttp_req-0.0.44a30}/dotextensions/server/handlers/gohandler.py +0 -0
  18. {dothttp_req-0.0.44a28 → dothttp_req-0.0.44a30}/dotextensions/server/handlers/har2httphandler.py +0 -0
  19. {dothttp_req-0.0.44a28 → dothttp_req-0.0.44a30}/dotextensions/server/handlers/http2har.py +0 -0
  20. {dothttp_req-0.0.44a28 → dothttp_req-0.0.44a30}/dotextensions/server/handlers/http2postman.py +0 -0
  21. {dothttp_req-0.0.44a28 → dothttp_req-0.0.44a30}/dotextensions/server/handlers/postman2http.py +0 -0
  22. {dothttp_req-0.0.44a28 → dothttp_req-0.0.44a30}/dotextensions/server/models/__init__.py +0 -0
  23. {dothttp_req-0.0.44a28 → dothttp_req-0.0.44a30}/dotextensions/server/models/har.py +0 -0
  24. {dothttp_req-0.0.44a28 → dothttp_req-0.0.44a30}/dotextensions/server/postman/__init__.py +0 -0
  25. {dothttp_req-0.0.44a28 → dothttp_req-0.0.44a30}/dotextensions/server/postman2_1/__init__.py +0 -0
  26. {dothttp_req-0.0.44a28 → dothttp_req-0.0.44a30}/dotextensions/server/server.py +0 -0
  27. {dothttp_req-0.0.44a28 → dothttp_req-0.0.44a30}/dotextensions/server/utils.py +0 -0
  28. {dothttp_req-0.0.44a28 → dothttp_req-0.0.44a30}/dotextensions/version/__init__.py +0 -0
  29. {dothttp_req-0.0.44a28 → dothttp_req-0.0.44a30}/dotextensions/version/__main__.py +0 -0
  30. {dothttp_req-0.0.44a28 → dothttp_req-0.0.44a30}/dothttp/__init__.py +0 -0
  31. {dothttp_req-0.0.44a28 → dothttp_req-0.0.44a30}/dothttp/__main__.py +0 -0
  32. {dothttp_req-0.0.44a28 → dothttp_req-0.0.44a30}/dothttp/__version__.py +0 -0
  33. {dothttp_req-0.0.44a28 → dothttp_req-0.0.44a30}/dothttp/auth/__init__.py +0 -0
  34. {dothttp_req-0.0.44a28 → dothttp_req-0.0.44a30}/dothttp/auth/azure_auth.py +0 -0
  35. {dothttp_req-0.0.44a28 → dothttp_req-0.0.44a30}/dothttp/exceptions.py +0 -0
  36. {dothttp_req-0.0.44a28 → dothttp_req-0.0.44a30}/dothttp/models/__init__.py +0 -0
  37. {dothttp_req-0.0.44a28 → dothttp_req-0.0.44a30}/dothttp/parse/dsl_jsonparser.py +0 -0
  38. {dothttp_req-0.0.44a28 → dothttp_req-0.0.44a30}/dothttp/parse/expression.py +0 -0
  39. {dothttp_req-0.0.44a28 → dothttp_req-0.0.44a30}/dothttp/parse/request_base.py +0 -0
  40. {dothttp_req-0.0.44a28 → dothttp_req-0.0.44a30}/dothttp/postScript.js +0 -0
  41. {dothttp_req-0.0.44a28 → dothttp_req-0.0.44a30}/dothttp/property_schema.py +0 -0
  42. {dothttp_req-0.0.44a28 → dothttp_req-0.0.44a30}/dothttp/script/__init__.py +0 -0
  43. {dothttp_req-0.0.44a28 → dothttp_req-0.0.44a30}/dothttp/utils/__init__.py +0 -0
  44. {dothttp_req-0.0.44a28 → dothttp_req-0.0.44a30}/dothttp/utils/common.py +0 -0
  45. {dothttp_req-0.0.44a28 → dothttp_req-0.0.44a30}/dothttp/utils/constants.py +0 -0
  46. {dothttp_req-0.0.44a28 → dothttp_req-0.0.44a30}/dothttp/utils/curl_utils.py +0 -0
  47. {dothttp_req-0.0.44a28 → dothttp_req-0.0.44a30}/dothttp/utils/json_utils.py +0 -0
  48. {dothttp_req-0.0.44a28 → dothttp_req-0.0.44a30}/dothttp/utils/log_utils.py +0 -0
  49. {dothttp_req-0.0.44a28 → dothttp_req-0.0.44a30}/dothttp/utils/property_util.py +0 -0
  50. {dothttp_req-0.0.44a28 → dothttp_req-0.0.44a30}/dothttp_test/__init__.py +0 -0
  51. {dothttp_req-0.0.44a28 → dothttp_req-0.0.44a30}/dothttp_test/__main__.py +0 -0
  52. {dothttp_req-0.0.44a28 → dothttp_req-0.0.44a30}/dothttp_test/conftest.py +0 -0
  53. {dothttp_req-0.0.44a28 → dothttp_req-0.0.44a30}/dothttp_test/dothttp_test.py +0 -0
@@ -1,24 +1,22 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dothttp-req
3
- Version: 0.0.44a28
3
+ Version: 0.0.44a30
4
4
  Summary: Dothttp is Simple http client for testing and development
5
5
  License: MIT
6
6
  License-File: LICENSE.txt
7
7
  Author: Prasanth
8
8
  Author-email: kesavarapu.siva@gmail.com
9
- Requires-Python: >=3.9,<3.15
9
+ Requires-Python: >=3.10,<3.15
10
10
  Classifier: License :: OSI Approved :: MIT License
11
11
  Classifier: Operating System :: OS Independent
12
12
  Classifier: Programming Language :: Python :: 3
13
- Classifier: Programming Language :: Python :: 3.9
14
13
  Classifier: Programming Language :: Python :: 3.10
15
14
  Classifier: Programming Language :: Python :: 3.11
16
15
  Classifier: Programming Language :: Python :: 3.12
17
16
  Classifier: Programming Language :: Python :: 3.13
18
17
  Classifier: Programming Language :: Python :: 3.14
19
- Provides-Extra: js
20
18
  Requires-Dist: faker (==37.12.0)
21
- Requires-Dist: jsonschema (==4.23.0)
19
+ Requires-Dist: jsonschema (==4.25.1)
22
20
  Requires-Dist: jstyleson (==0.0.2)
23
21
  Requires-Dist: msal (==1.34.0)
24
22
  Requires-Dist: parsys-requests-unixsocket (==0.3.2)
@@ -314,7 +314,7 @@ HTTP_TEST_SCRIPT:
314
314
  ;
315
315
 
316
316
  SCRIPT_LANGUAGE:
317
- 'python' | 'javascript'
317
+ 'python'
318
318
  ;
319
319
 
320
320
  SLASH:
@@ -86,7 +86,7 @@ class HttpDef:
86
86
  session_clear = False
87
87
  no_parent_script = False
88
88
  test_script: str = ""
89
- test_script_lang: ScriptType = ScriptType.JAVA_SCRIPT
89
+ test_script_lang: ScriptType = ScriptType.PYTHON
90
90
  proxy: Optional[Dict[str, str]] = None
91
91
 
92
92
  def get_har(self):
@@ -179,7 +179,6 @@ class ToFile:
179
179
 
180
180
  @dataclass
181
181
  class LangOption:
182
- javascript: Optional[str]
183
182
  python: Optional[str]
184
183
 
185
184
 
@@ -511,11 +510,7 @@ class HttpFileType(enum.Enum):
511
510
 
512
511
  class ScriptType(enum.Enum):
513
512
  PYTHON = "python"
514
- JAVA_SCRIPT = "javascript"
515
513
 
516
514
  @staticmethod
517
515
  def get_script_type(script_type: LangOption):
518
- if script_type == "javascript":
519
- return ScriptType.JAVA_SCRIPT
520
- else:
521
- return ScriptType.PYTHON
516
+ return ScriptType.PYTHON
@@ -46,7 +46,7 @@ from ..models.parse_models import (
46
46
  TestScript,
47
47
  )
48
48
  from ..property_schema import property_schema
49
- from ..script import ScriptExecutionJs, ScriptExecutionPython
49
+ from ..script import ScriptExecutionPython
50
50
  from ..utils.common import get_real_file_path, triple_or_double_tostring, single_triple_or_double_tostring
51
51
  from ..utils.constants import *
52
52
  from ..utils.property_util import PropertyProvider, StringFormatPropertyResolver
@@ -941,12 +941,7 @@ class HttpDefBase(BaseModelProcessor):
941
941
  self.script_execution.pre_request_script()
942
942
 
943
943
  def run_prerequest_script(self):
944
- execution_cls = (
945
- ScriptExecutionJs
946
- if self.httpdef.test_script_lang == ScriptType.JAVA_SCRIPT
947
- else ScriptExecutionPython
948
- )
949
- self.script_execution = execution_cls(self.httpdef, self.property_util)
944
+ self.script_execution = ScriptExecutionPython(self.httpdef, self.property_util)
950
945
  self.script_execution.init_request_script()
951
946
  for key, value in self.script_execution.client.properties.updated.items():
952
947
  self.property_util.add_command_line_property(key, value)
@@ -32,12 +32,6 @@ from ..parse import MIME_TYPE_JSON, HttpDef, request_logger
32
32
  from ..utils.common import get_real_file_path
33
33
  from ..utils.property_util import PropertyProvider
34
34
 
35
- try:
36
- import js2py
37
- from js2py.base import JsObjectWrapper
38
- from js2py.internals.simplex import JsException
39
- except:
40
- pass
41
35
 
42
36
 
43
37
  def write_guard(x):
@@ -79,11 +73,6 @@ allowed_global = {
79
73
  }
80
74
  allowed_global.update(safe_globals)
81
75
 
82
- # disable python imports
83
- # js2py.disable_pyimport() # so that few libraries can be imported
84
-
85
- with open(get_real_file_path("../postScript.js", __file__)) as f:
86
- js_template = f.read()
87
76
 
88
77
 
89
78
  @dataclass
@@ -228,49 +217,6 @@ class ScriptExecutionEnvironmentBase:
228
217
  return script_result
229
218
 
230
219
 
231
- class ScriptExecutionJs(ScriptExecutionEnvironmentBase):
232
- def _execute_test_script(self, resp) -> None:
233
- # enable require will only be used for
234
- # those who want to use require in dothttp scripts
235
- # i will write up a document on how to do it
236
- context = js2py.EvalJs(enable_require=True)
237
- try:
238
- context.execute(
239
- js_template.replace("JS_CODE_REPLACE", self.client.request.test_script)
240
- )
241
- except JsException as exc:
242
- raise ScriptException(payload=str(exc), function="''")
243
- content_type = resp.headers.get("content-type", "text/plain")
244
- # in some cases mimetype can have charset
245
- # like text/plain; charset=utf-8
246
- content_type = (
247
- content_type.split(";")[0] if ";" in content_type else content_type
248
- )
249
- client = context.jsHandler(
250
- content_type == MIME_TYPE_JSON,
251
- self.client.properties,
252
- resp.text,
253
- resp.status_code,
254
- dict(resp.headers),
255
- )
256
- script_result = ScriptResult(stdout="", error="", properties={}, tests=[])
257
- for test_name in client.tests:
258
- test_result = TestResult(test_name)
259
- try:
260
- test_result.result = client.tests[test_name]()
261
- test_result.success = True
262
- except Exception as exc:
263
- test_result.error = str(exc)
264
- test_result.success = False
265
- request_logger.error(f"test execution failed {exc}")
266
- script_result.tests.append(test_result)
267
- for i in client.properties.updated:
268
- if not isinstance(client.properties.vars[i], JsObjectWrapper):
269
- script_result.properties[i] = client.properties.vars[i] or ""
270
- script_result.stdout += "\n".join(client.stdout)
271
- return script_result
272
-
273
-
274
220
  class ScriptExecutionPython(ScriptExecutionEnvironmentBase):
275
221
  def __init__(self, httpdef: HttpDef, prop: PropertyProvider) -> None:
276
222
  super().__init__(httpdef, prop)
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "dothttp-req"
3
- version = "0.0.44a28"
3
+ version = "0.0.44a30"
4
4
  description = "Dothttp is Simple http client for testing and development"
5
5
  authors = ["Prasanth <kesavarapu.siva@gmail.com>"]
6
6
  license = "MIT"
@@ -21,8 +21,8 @@ dothttp = 'dothttp.__main__:main'
21
21
 
22
22
 
23
23
  [tool.poetry.dependencies]
24
- python = ">=3.9,<3.15"
25
- jsonschema = "4.23.0"
24
+ python = ">=3.10,<3.15"
25
+ jsonschema = "4.25.1"
26
26
  jstyleson = "0.0.2"
27
27
  textx = "4.2.3"
28
28
  requests-pkcs12 = "1.27"
@@ -40,15 +40,14 @@ xmltodict = "^1.0.2"
40
40
 
41
41
  [tool.poetry.group.dev.dependencies]
42
42
  waitress = "3.0.2"
43
- flask = "3.1.2"
43
+ flask = "3.1.3"
44
44
  python-magic = "^0.4.27"
45
- js2py = "0.74"
46
45
  flask-cors = "^6.0.1"
47
- pytest = "^8.3.5"
46
+ pytest = "^8.4.2"
48
47
  pytest-html = "^4.1.1"
49
-
50
- [tool.poetry.extras]
51
- js = ["js2py"]
48
+ pytest-xdist = "^3.6.1"
49
+ gunicorn = "^23.0.0"
50
+ httpbin = "^0.10.2"
52
51
 
53
52
  [build-system]
54
53
  requires = ["poetry-core"]