@@ -22,7 +22,7 @@ python pyresttest/resttest.py https://api.github.com fancypants_test.yaml --impo
22
22
23
23
## What does an extension look like?
24
24
``` python
25
- import py3resttest .validators as validators
25
+ import resttest3 .validators as validators
26
26
27
27
# Define a simple generator that doubles with each value
28
28
def parse_generator_doubling (config ):
@@ -44,11 +44,6 @@ GENERATORS = {'doubling': parse_generator_doubling}
44
44
45
45
If this is imported when executing the test, you can now use this generator in tests.
46
46
47
- # Full Example
48
- See the [ sample extension] ( pyresttest/tests/sample_extension.py ) .
49
- It shows an extension for all extensible functions.
50
-
51
-
52
47
# What Doe An Extension Need To Work?
53
48
54
49
1 . Function(s) to run
@@ -105,6 +100,8 @@ The 'parse' function below will be registered in the registry.
105
100
106
101
Example:
107
102
``` python
103
+
104
+ from resttest3.validators import AbstractExtractor
108
105
class HeaderExtractor (AbstractExtractor ):
109
106
""" Extractor that pulls out a named header """
110
107
extractor_type = ' header' # Printable name for the type
@@ -133,6 +130,9 @@ Validators should extend AbstractValidator.
133
130
The parse function below will be registered in the registry VALIDATORS.
134
131
135
132
``` python
133
+ from resttest3.validators import AbstractValidator, _get_extractor, Failure
134
+ from resttest3.utils import Parser
135
+ from resttest3.constants import VALIDATOR_TESTS
136
136
class ExtractTestValidator (AbstractValidator ):
137
137
""" Does extract and test from request body """
138
138
name = ' ExtractTestValidator'
@@ -145,7 +145,7 @@ class ExtractTestValidator(AbstractValidator):
145
145
def parse (config ):
146
146
""" Config is a dict """
147
147
output = ExtractTestValidator()
148
- config = parsing.lowercase_keys(parsing.flatten_dictionaries( config) )
148
+ config = Parser.flatten_lowercase_keys_dict( config)
149
149
output.config = config
150
150
extractor = _get_extractor(config)
151
151
output.extractor = extractor
0 commit comments