robotframework-schemathesislibrary 2.8.2__tar.gz → 3.0.1__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 (12) hide show
  1. {robotframework_schemathesislibrary-2.8.2/src/robotframework_schemathesislibrary.egg-info → robotframework_schemathesislibrary-3.0.1}/PKG-INFO +3 -3
  2. {robotframework_schemathesislibrary-2.8.2 → robotframework_schemathesislibrary-3.0.1}/pyproject.toml +11 -6
  3. {robotframework_schemathesislibrary-2.8.2 → robotframework_schemathesislibrary-3.0.1}/src/SchemathesisLibrary/__init__.py +7 -3
  4. {robotframework_schemathesislibrary-2.8.2 → robotframework_schemathesislibrary-3.0.1}/src/SchemathesisLibrary/schemathesisreader.py +10 -6
  5. {robotframework_schemathesislibrary-2.8.2 → robotframework_schemathesislibrary-3.0.1/src/robotframework_schemathesislibrary.egg-info}/PKG-INFO +3 -3
  6. {robotframework_schemathesislibrary-2.8.2 → robotframework_schemathesislibrary-3.0.1}/src/robotframework_schemathesislibrary.egg-info/requires.txt +1 -1
  7. {robotframework_schemathesislibrary-2.8.2 → robotframework_schemathesislibrary-3.0.1}/LICENSE +0 -0
  8. {robotframework_schemathesislibrary-2.8.2 → robotframework_schemathesislibrary-3.0.1}/README.md +0 -0
  9. {robotframework_schemathesislibrary-2.8.2 → robotframework_schemathesislibrary-3.0.1}/setup.cfg +0 -0
  10. {robotframework_schemathesislibrary-2.8.2 → robotframework_schemathesislibrary-3.0.1}/src/robotframework_schemathesislibrary.egg-info/SOURCES.txt +0 -0
  11. {robotframework_schemathesislibrary-2.8.2 → robotframework_schemathesislibrary-3.0.1}/src/robotframework_schemathesislibrary.egg-info/dependency_links.txt +0 -0
  12. {robotframework_schemathesislibrary-2.8.2 → robotframework_schemathesislibrary-3.0.1}/src/robotframework_schemathesislibrary.egg-info/top_level.txt +0 -0
@@ -1,17 +1,17 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: robotframework-schemathesislibrary
3
- Version: 2.8.2
3
+ Version: 3.0.1
4
4
  Summary: Robot Framework SchemathesisLibrary to automatically create test cases from API specifications.
5
5
  Author-email: Tatu Aalto <aalto.tatu@gmail.com>
6
6
  License-Expression: Apache-2.0
7
7
  Keywords: Robot Framework,Schemathesis,API Testing,Test Automation
8
- Requires-Python: >=3.10.1
8
+ Requires-Python: >=3.11
9
9
  Description-Content-Type: text/markdown
10
10
  License-File: LICENSE
11
11
  Requires-Dist: robotframework>=7.2.2
12
12
  Requires-Dist: robotframework-datadriver>=1.11.2
13
13
  Requires-Dist: robotframework-pythonlibcore>=4.6.0
14
- Requires-Dist: schemathesis>=4.25.0
14
+ Requires-Dist: schemathesis>=4.34.0
15
15
  Dynamic: license-file
16
16
 
17
17
  # Robot Framework SchemathesisLibrary
@@ -1,19 +1,19 @@
1
1
  [project]
2
2
  name = "robotframework-schemathesislibrary"
3
- version = "2.8.2"
3
+ version = "3.0.1"
4
4
  description = "Robot Framework SchemathesisLibrary to automatically create test cases from API specifications."
5
5
  authors = [
6
6
  { name="Tatu Aalto", email="aalto.tatu@gmail.com" },
7
7
  ]
8
8
  readme = "README.md"
9
9
  license = "Apache-2.0"
10
- requires-python = ">=3.10.1"
10
+ requires-python = ">=3.11"
11
11
  keywords = ["Robot Framework", "Schemathesis", "API Testing", "Test Automation"]
12
12
  dependencies = [
13
13
  "robotframework>=7.2.2",
14
14
  "robotframework-datadriver>=1.11.2",
15
15
  "robotframework-pythonlibcore>=4.6.0",
16
- "schemathesis>=4.25.0",
16
+ "schemathesis>=4.34.0",
17
17
  ]
18
18
 
19
19
  [dependency-groups]
@@ -27,10 +27,15 @@ dev = [
27
27
  "robotframework-pabot>=5.2.2",
28
28
  "robotframework-requests>=0.9.7",
29
29
  "robotframework-robocop>=8.3.2",
30
- "ruff==0.16.10",
30
+ "ruff==0.17.6",
31
31
  "markdown>=3.10.2",
32
32
  ]
33
33
 
34
+ [tool.coverage.run]
35
+ branch = true
36
+ parallel = true
37
+ include = ["*/src/SchemathesisLibrary/*"]
38
+
34
39
  [tool.semantic_release.settings]
35
40
  allow_zero_version = true
36
41
 
@@ -50,7 +55,7 @@ configure = [
50
55
 
51
56
  [tool.ruff]
52
57
  line-length = 110
53
- target-version = "py310"
58
+ target-version = "py311"
54
59
 
55
60
  [tool.ruff.lint]
56
61
  select = [
@@ -109,5 +114,5 @@ ignore = [
109
114
  quote-style = "double"
110
115
 
111
116
  [tool.mypy]
112
- python_version = "3.10"
117
+ python_version = "3.11"
113
118
  files = "src/SchemathesisLibrary"
@@ -39,7 +39,7 @@ if TYPE_CHECKING:
39
39
 
40
40
  from schemathesis.config import SanitizationConfig
41
41
 
42
- __version__ = "2.8.2"
42
+ __version__ = "3.0.1"
43
43
 
44
44
 
45
45
  class SchemathesisLibrary(DynamicCore):
@@ -707,7 +707,8 @@ class SchemathesisLibrary(DynamicCore):
707
707
  A body that went over the wire is bytes or a string, so it has to be parsed back into
708
708
  a structure before the values in it can be replaced. A body that is not JSON can not be
709
709
  inspected and is returned untouched, and so is a body that holds nothing sensitive,
710
- which keeps it in the exact form it was sent in.
710
+ which keeps it in the exact form it was sent in. A sanitized body keeps its type, so
711
+ that what a body holds does not change the form it is logged in.
711
712
  """
712
713
  if not isinstance(body, str | bytes):
713
714
  return self._sanitize(case, body)
@@ -720,7 +721,10 @@ class SchemathesisLibrary(DynamicCore):
720
721
  if not isinstance(parsed, dict | list):
721
722
  return body
722
723
  sanitized = self._sanitize(case, parsed)
723
- return body if sanitized == parsed else json.dumps(sanitized)
724
+ if sanitized == parsed:
725
+ return body
726
+ serialized = json.dumps(sanitized)
727
+ return serialized.encode() if isinstance(body, bytes) else serialized
724
728
 
725
729
  def _sanitize_url(self, case: Case, url: "str|None") -> "str|None":
726
730
  config = self._sanitization_config(case)
@@ -51,11 +51,7 @@ class SchemathesisReader(AbstractReaderClass):
51
51
  if path and not Path(path).is_file():
52
52
  raise ValueError(f"Provided path '{path}' is not a valid file.")
53
53
  config, generation_mode = self._load_config()
54
- # Schema loading dispatches `before_load_schema` / `after_load_schema`; hooks must be registered first.
55
- if self.options.auth:
56
- import_extensions(self.options.auth)
57
- logger.info(f"Using auth extension from: {self.options.auth}")
58
- self._import_hooks()
54
+ self._import_extensions()
59
55
  if path:
60
56
  schema = openapi.from_path(path, config=config)
61
57
  elif url:
@@ -130,9 +126,17 @@ class SchemathesisReader(AbstractReaderClass):
130
126
  logger.info("No schemathesis.toml config file found, using defaults")
131
127
  return config, generation_mode
132
128
 
133
- def _import_hooks(self) -> None:
129
+ def _import_extensions(self) -> None:
130
+ """Import auth and hook extensions, which register themselves as a side effect of the import.
131
+
132
+ Must run before the schema is loaded, because loading dispatches the
133
+ `before_load_schema` and `after_load_schema` hooks.
134
+ """
134
135
  if not self.options:
135
136
  return
137
+ if self.options.auth:
138
+ import_extensions(self.options.auth)
139
+ logger.info(f"Using auth extension from: {self.options.auth}")
136
140
  if not self.options.hook:
137
141
  return
138
142
  for hook in self.options.hook.split(";"):
@@ -1,17 +1,17 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: robotframework-schemathesislibrary
3
- Version: 2.8.2
3
+ Version: 3.0.1
4
4
  Summary: Robot Framework SchemathesisLibrary to automatically create test cases from API specifications.
5
5
  Author-email: Tatu Aalto <aalto.tatu@gmail.com>
6
6
  License-Expression: Apache-2.0
7
7
  Keywords: Robot Framework,Schemathesis,API Testing,Test Automation
8
- Requires-Python: >=3.10.1
8
+ Requires-Python: >=3.11
9
9
  Description-Content-Type: text/markdown
10
10
  License-File: LICENSE
11
11
  Requires-Dist: robotframework>=7.2.2
12
12
  Requires-Dist: robotframework-datadriver>=1.11.2
13
13
  Requires-Dist: robotframework-pythonlibcore>=4.6.0
14
- Requires-Dist: schemathesis>=4.25.0
14
+ Requires-Dist: schemathesis>=4.34.0
15
15
  Dynamic: license-file
16
16
 
17
17
  # Robot Framework SchemathesisLibrary
@@ -1,4 +1,4 @@
1
1
  robotframework>=7.2.2
2
2
  robotframework-datadriver>=1.11.2
3
3
  robotframework-pythonlibcore>=4.6.0
4
- schemathesis>=4.25.0
4
+ schemathesis>=4.34.0