schemathesis 3.39.2__py3-none-any.whl → 3.39.4__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.
@@ -199,21 +199,26 @@ def add_examples(
199
199
  if invalid_headers:
200
200
  add_invalid_example_header_mark(original_test, invalid_headers)
201
201
  continue
202
- if example.media_type is not None:
203
- try:
204
- media_type = parse_content_type(example.media_type)
205
- if media_type == ("application", "x-www-form-urlencoded"):
206
- example.body = prepare_urlencoded(example.body)
207
- except ValueError:
208
- pass
202
+ adjust_urlencoded_payload(example)
209
203
  test = hypothesis.example(case=example)(test)
210
204
  return test
211
205
 
212
206
 
207
+ def adjust_urlencoded_payload(case: Case) -> None:
208
+ if case.media_type is not None:
209
+ try:
210
+ media_type = parse_content_type(case.media_type)
211
+ if media_type == ("application", "x-www-form-urlencoded"):
212
+ case.body = prepare_urlencoded(case.body)
213
+ except ValueError:
214
+ pass
215
+
216
+
213
217
  def add_coverage(
214
218
  test: Callable, operation: APIOperation, data_generation_methods: list[DataGenerationMethod]
215
219
  ) -> Callable:
216
220
  for example in _iter_coverage_cases(operation, data_generation_methods):
221
+ adjust_urlencoded_payload(example)
217
222
  test = hypothesis.example(case=example)(test)
218
223
  return test
219
224
 
@@ -322,7 +327,7 @@ def _iter_coverage_cases(
322
327
  case = operation.make_case(**template)
323
328
  case._explicit_method = method
324
329
  case.data_generation_method = DataGenerationMethod.negative
325
- case.meta = _make_meta(description=f"Unspecified HTTP method: {method}")
330
+ case.meta = _make_meta(description=f"Unspecified HTTP method: {method.upper()}")
326
331
  yield case
327
332
  # Generate duplicate query parameters
328
333
  if operation.query:
@@ -518,7 +523,7 @@ def prepare_urlencoded(data: Any) -> Any:
518
523
  for key, value in item.items():
519
524
  output.append((key, value))
520
525
  else:
521
- output.append(item)
526
+ output.append((item, "arbitrary-value"))
522
527
  return output
523
528
  return data
524
529
 
schemathesis/models.py CHANGED
@@ -632,6 +632,7 @@ class Case:
632
632
  id=self.id,
633
633
  _auth=self._auth,
634
634
  _has_explicit_auth=self._has_explicit_auth,
635
+ _explicit_method=self._explicit_method,
635
636
  )
636
637
 
637
638
 
@@ -408,7 +408,8 @@ def find_matching_in_responses(examples: dict[str, list], param: str) -> Iterato
408
408
  if found is not NOT_FOUND:
409
409
  yield found
410
410
  continue
411
- example = inner
411
+ if isinstance(inner, dict):
412
+ example = inner
412
413
  found = _find_matching_in_responses(example, schema_name, param, normalized, is_id_param)
413
414
  if found is not NOT_FOUND:
414
415
  yield found
@@ -420,6 +421,8 @@ def _find_matching_in_responses(
420
421
  # Check for exact match
421
422
  if param in example:
422
423
  return example[param]
424
+ if is_id_param and param[:-2] in example:
425
+ return example[param[:-2]]
423
426
 
424
427
  # Check for case-insensitive match
425
428
  for key in example:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: schemathesis
3
- Version: 3.39.2
3
+ Version: 3.39.4
4
4
  Summary: Property-based testing framework for Open API and GraphQL based apps
5
5
  Project-URL: Documentation, https://schemathesis.readthedocs.io/en/stable/
6
6
  Project-URL: Changelog, https://schemathesis.readthedocs.io/en/stable/changelog.html
@@ -1,7 +1,7 @@
1
1
  schemathesis/__init__.py,sha256=UW2Bq8hDDkcBeAAA7PzpBFXkOOxkmHox-mfQwzHDjL0,1914
2
2
  schemathesis/_compat.py,sha256=y4RZd59i2NCnZ91VQhnKeMn_8t3SgvLOk2Xm8nymUHY,1837
3
3
  schemathesis/_dependency_versions.py,sha256=pjEkkGAfOQJYNb-9UOo84V8nj_lKHr_TGDVdFwY2UU0,816
4
- schemathesis/_hypothesis.py,sha256=PsmomVk_mXZaqhOZJh5qftYSJ7qJs3wwBTSITiBXvT0,24273
4
+ schemathesis/_hypothesis.py,sha256=UTvx-hN-kUMZqBPDcDrg4KFbGfQLLMfMCtD82OSmv_k,24401
5
5
  schemathesis/_lazy_import.py,sha256=aMhWYgbU2JOltyWBb32vnWBb6kykOghucEzI_F70yVE,470
6
6
  schemathesis/_override.py,sha256=TAjYB3eJQmlw9K_xiR9ptt9Wj7if4U7UFlUhGjpBAoM,1625
7
7
  schemathesis/_patches.py,sha256=Hsbpn4UVeXUQD2Kllrbq01CSWsTYENWa0VJTyhX5C2k,895
@@ -18,7 +18,7 @@ schemathesis/graphql.py,sha256=XiuKcfoOB92iLFC8zpz2msLkM0_V0TLdxPNBqrrGZ8w,216
18
18
  schemathesis/hooks.py,sha256=p5AXgjVGtka0jn9MOeyBaRUtNbqZTs4iaJqytYTacHc,14856
19
19
  schemathesis/lazy.py,sha256=Ddhkk7Tpc_VcRGYkCtKDmP2gpjxVmEZ3b01ZTNjbm8I,19004
20
20
  schemathesis/loaders.py,sha256=MoEhcdOEBJxNRn5X-ZNhWB9jZDHQQNpkNfEdQjf_NDw,4590
21
- schemathesis/models.py,sha256=QNeK1sGcNAhrJ452YZoLZIRsOHS6cOt1AYFLJhBPcJs,49962
21
+ schemathesis/models.py,sha256=4MX3ErKMdueUXGcVPZuvMTbesUglbuj0ukgCmg3nhP8,50014
22
22
  schemathesis/parameters.py,sha256=izlu4MFYT1RWrC4RBxrV6weeCal-ODbdLQLMb0PYCZY,2327
23
23
  schemathesis/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
24
24
  schemathesis/sanitization.py,sha256=Lycn1VVfula9B6XpzkxTHja7CZ7RHqbUh9kBic0Yi4M,9056
@@ -111,7 +111,7 @@ schemathesis/specs/openapi/checks.py,sha256=fWtI7rq4wi6qK2E9U_hdJlIyIBVTCB4Klh_3
111
111
  schemathesis/specs/openapi/constants.py,sha256=JqM_FHOenqS_MuUE9sxVQ8Hnw0DNM8cnKDwCwPLhID4,783
112
112
  schemathesis/specs/openapi/converter.py,sha256=Yxw9lS_JKEyi-oJuACT07fm04bqQDlAu-iHwzkeDvE4,3546
113
113
  schemathesis/specs/openapi/definitions.py,sha256=WTkWwCgTc3OMxfKsqh6YDoGfZMTThSYrHGp8h0vLAK0,93935
114
- schemathesis/specs/openapi/examples.py,sha256=FwhPWca7bpdHpUp_LRoK09DVgusojO3aXXhXYrK373I,20354
114
+ schemathesis/specs/openapi/examples.py,sha256=hdeq7et8AexYGY2iU6SfMZWJ7G0PbOfapUtc4upNs_4,20483
115
115
  schemathesis/specs/openapi/formats.py,sha256=3KtEC-8nQRwMErS-WpMadXsr8R0O-NzYwFisZqMuc-8,2761
116
116
  schemathesis/specs/openapi/links.py,sha256=C4Uir2P_EcpqME8ee_a1vdUM8Tm3ZcKNn2YsGjZiMUQ,17935
117
117
  schemathesis/specs/openapi/loaders.py,sha256=5B1cgYEBj3h2psPQxzrQ5Xq5owLVGw-u9HsCQIx7yFE,25705
@@ -153,8 +153,8 @@ schemathesis/transports/auth.py,sha256=urSTO9zgFO1qU69xvnKHPFQV0SlJL3d7_Ojl0tLnZ
153
153
  schemathesis/transports/content_types.py,sha256=MiKOm-Hy5i75hrROPdpiBZPOTDzOwlCdnthJD12AJzI,2187
154
154
  schemathesis/transports/headers.py,sha256=hr_AIDOfUxsJxpHfemIZ_uNG3_vzS_ZeMEKmZjbYiBE,990
155
155
  schemathesis/transports/responses.py,sha256=OFD4ZLqwEFpo7F9vaP_SVgjhxAqatxIj38FS4XVq8Qs,1680
156
- schemathesis-3.39.2.dist-info/METADATA,sha256=mrOeTevX0mrdFm-n_sjh0MIHgKaOS-QCk8KvPDMOxL0,12956
157
- schemathesis-3.39.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
158
- schemathesis-3.39.2.dist-info/entry_points.txt,sha256=VHyLcOG7co0nOeuk8WjgpRETk5P1E2iCLrn26Zkn5uk,158
159
- schemathesis-3.39.2.dist-info/licenses/LICENSE,sha256=PsPYgrDhZ7g9uwihJXNG-XVb55wj2uYhkl2DD8oAzY0,1103
160
- schemathesis-3.39.2.dist-info/RECORD,,
156
+ schemathesis-3.39.4.dist-info/METADATA,sha256=pR_nsqtFTUMX56DrJy_l9D9Ir8AaT1YkRxM-W0Xz1JA,12956
157
+ schemathesis-3.39.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
158
+ schemathesis-3.39.4.dist-info/entry_points.txt,sha256=VHyLcOG7co0nOeuk8WjgpRETk5P1E2iCLrn26Zkn5uk,158
159
+ schemathesis-3.39.4.dist-info/licenses/LICENSE,sha256=PsPYgrDhZ7g9uwihJXNG-XVb55wj2uYhkl2DD8oAzY0,1103
160
+ schemathesis-3.39.4.dist-info/RECORD,,