schemathesis 3.20.0__py3-none-any.whl → 3.20.1__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.
@@ -18,11 +18,29 @@ from ..stateful import Stateful
18
18
  from ..types import PathLike
19
19
  from .constants import DEFAULT_WORKERS
20
20
 
21
+ INVALID_DERANDOMIZE_MESSAGE = (
22
+ "`--hypothesis-derandomize` implies no database, so passing `--hypothesis-database` too is invalid."
23
+ )
21
24
  MISSING_CASSETTE_PATH_ARGUMENT_MESSAGE = (
22
25
  'Missing argument, "--cassette-path" should be specified as well if you use "--cassette-preserve-exact-body-bytes".'
23
26
  )
24
27
  INVALID_SCHEMA_MESSAGE = "Invalid SCHEMA, must be a valid URL, file path or an API name from Schemathesis.io."
25
28
  FILE_DOES_NOT_EXIST_MESSAGE = "The specified file does not exist. Please provide a valid path to an existing file."
29
+ INVALID_BASE_URL_MESSAGE = (
30
+ "The provided base URL is invalid. This URL serves as a prefix for all API endpoints you want to test. "
31
+ "Make sure it is a properly formatted URL."
32
+ )
33
+ MISSING_BASE_URL_MESSAGE = "The `--base-url` option is required when specifying a schema via a file."
34
+ APPLICATION_FORMAT_MESSAGE = """Unable to import application from the provided module.
35
+ The `--app` option should follow this format:
36
+
37
+ module_path:variable_name
38
+
39
+ - `module_path`: A path to an importable Python module.
40
+ - `variable_name`: The name of the application variable within that module.
41
+
42
+ Example: `st run --app=your_module:app ...`"""
43
+ MISSING_REQUEST_CERT_MESSAGE = "The `--request-cert` option must be specified if `--request-cert-key` is used."
26
44
 
27
45
 
28
46
  @enum.unique
@@ -74,7 +92,7 @@ def validate_schema(
74
92
  if not utils.file_exists(schema):
75
93
  message = FILE_DOES_NOT_EXIST_MESSAGE
76
94
  else:
77
- message = 'Missing argument, "--base-url" is required for SCHEMA specified by file.'
95
+ message = MISSING_BASE_URL_MESSAGE
78
96
  raise click.UsageError(message)
79
97
  if kind == SchemaInputKind.NAME:
80
98
  if api_name is not None:
@@ -92,9 +110,9 @@ def validate_base_url(ctx: click.core.Context, param: click.core.Parameter, raw_
92
110
  try:
93
111
  netloc = urlparse(raw_value).netloc
94
112
  except ValueError as exc:
95
- raise click.UsageError("Invalid base URL") from exc
113
+ raise click.UsageError(INVALID_BASE_URL_MESSAGE) from exc
96
114
  if raw_value and not netloc:
97
- raise click.UsageError("Invalid base URL")
115
+ raise click.UsageError(INVALID_BASE_URL_MESSAGE)
98
116
  return raw_value
99
117
 
100
118
 
@@ -110,14 +128,6 @@ def validate_rate_limit(
110
128
  raise click.UsageError(exc.args[0]) from exc
111
129
 
112
130
 
113
- APPLICATION_FORMAT_MESSAGE = (
114
- "Can not import application from the given module!\n"
115
- "The `--app` option value should be in format:\n\n path:variable\n\n"
116
- "where `path` is an importable path to a Python module,\n"
117
- "and `variable` is a variable name inside that module."
118
- )
119
-
120
-
121
131
  def validate_app(ctx: click.core.Context, param: click.core.Parameter, raw_value: Optional[str]) -> Optional[str]:
122
132
  if raw_value is None:
123
133
  return raw_value
@@ -145,9 +155,7 @@ def validate_hypothesis_database(
145
155
  if raw_value is None:
146
156
  return raw_value
147
157
  if ctx.params.get("hypothesis_derandomize"):
148
- raise click.UsageError(
149
- "--hypothesis-derandomize implies no database, so passing --hypothesis-database too is invalid."
150
- )
158
+ raise click.UsageError(INVALID_DERANDOMIZE_MESSAGE)
151
159
  return raw_value
152
160
 
153
161
 
@@ -201,7 +209,7 @@ def validate_request_cert_key(
201
209
  ctx: click.core.Context, param: click.core.Parameter, raw_value: Optional[str]
202
210
  ) -> Optional[str]:
203
211
  if raw_value is not None and "request_cert" not in ctx.params:
204
- raise click.UsageError('Missing argument, "--request-cert" should be specified as well.')
212
+ raise click.UsageError(MISSING_REQUEST_CERT_MESSAGE)
205
213
  return raw_value
206
214
 
207
215
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: schemathesis
3
- Version: 3.20.0
3
+ Version: 3.20.1
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
@@ -26,7 +26,7 @@ schemathesis/throttling.py,sha256=kDU0G75FxzxalcIOnWgeYDPNLoZZpkMjSXYG5cLALmg,94
26
26
  schemathesis/types.py,sha256=ZRJJKTBBucAIvI7d_Wdb4sGQzmg-I0II7rONccncV3E,1043
27
27
  schemathesis/utils.py,sha256=my1GuJrG39rolFZ2ml_YrjVHXQvE7bIuV1mi88nzDkM,17471
28
28
  schemathesis/cli/__init__.py,sha256=_AKgxyDGZjmIXRfNLUigpRJmoM_bkFdfE9RBl_xyvWs,51482
29
- schemathesis/cli/callbacks.py,sha256=Vep2ez28y4oYIPbqFsRPUFioyBgMAuWCB5g38u-CkVs,11379
29
+ schemathesis/cli/callbacks.py,sha256=gXj5U24GeCniwZ2nr9Y3Yxlz3iAyTMRSiSXE539-E6Y,11806
30
30
  schemathesis/cli/cassettes.py,sha256=jarSEWd_p_u1pOsL_-ZnCbciZRbQX5CRZRXUD4GqB7Q,12689
31
31
  schemathesis/cli/constants.py,sha256=OpyINEiuVqdsJ9bn3NOBoQeD-bdxKFbawLKkgahk2uw,63
32
32
  schemathesis/cli/context.py,sha256=rSdh40IRe1rtkdjTb38HBUn5Xbb_dqaAK0EY925J7F4,1410
@@ -106,8 +106,8 @@ schemathesis/specs/openapi/negative/types.py,sha256=a7buCcVxNBG6ILBM3A7oNTAX0lyD
106
106
  schemathesis/specs/openapi/negative/utils.py,sha256=ozcOIuASufLqZSgnKUACjX-EOZrrkuNdXX0SDnLoGYA,168
107
107
  schemathesis/specs/openapi/stateful/__init__.py,sha256=CS8yxgIwvbiGkvav4xEPYkKOIhVK4-xpUAv7U45nW8M,4466
108
108
  schemathesis/specs/openapi/stateful/links.py,sha256=yrTHH6kdPhM2WpxksyfShf98mkb8ZP6fjXFyTzUbXfo,3487
109
- schemathesis-3.20.0.dist-info/METADATA,sha256=yP2xyAxFsL12MfnzX4sGM3KVKN0WWQAKsZYTx7jiHZ0,15118
110
- schemathesis-3.20.0.dist-info/WHEEL,sha256=hKi7AIIx6qfnsRbr087vpeJnrVUuDokDHZacPPMW7-Y,87
111
- schemathesis-3.20.0.dist-info/entry_points.txt,sha256=VHyLcOG7co0nOeuk8WjgpRETk5P1E2iCLrn26Zkn5uk,158
112
- schemathesis-3.20.0.dist-info/licenses/LICENSE,sha256=PsPYgrDhZ7g9uwihJXNG-XVb55wj2uYhkl2DD8oAzY0,1103
113
- schemathesis-3.20.0.dist-info/RECORD,,
109
+ schemathesis-3.20.1.dist-info/METADATA,sha256=9O5hlIPaqD6oHzMCX-3NpVMWn9t-BVN2ul1q6U4fzUw,15118
110
+ schemathesis-3.20.1.dist-info/WHEEL,sha256=hKi7AIIx6qfnsRbr087vpeJnrVUuDokDHZacPPMW7-Y,87
111
+ schemathesis-3.20.1.dist-info/entry_points.txt,sha256=VHyLcOG7co0nOeuk8WjgpRETk5P1E2iCLrn26Zkn5uk,158
112
+ schemathesis-3.20.1.dist-info/licenses/LICENSE,sha256=PsPYgrDhZ7g9uwihJXNG-XVb55wj2uYhkl2DD8oAzY0,1103
113
+ schemathesis-3.20.1.dist-info/RECORD,,