Fellowship command¶
Contract tester based on json schema
usage: fellowship [-h] {validate,validate_grpc,generate,generate_grpc} ...
Sub-commands:¶
validate¶
Validate command runs validation of contracts, by iterating over the contracts located in the directory passed by the path arg. During execution, fellowship prints a report to the command line displaying the result. If the validation of any contract is invalid, fellowship raises RestTesterException at the end of the run.
fellowship validate [-h] path
Positional Arguments¶
- path
The path to contract directory, that contains the contracts that should be validated
validate_grpc¶
Validate command runs validation of contracts, by iterating over the contracts located in the directory passed by the path arg. During execution, fellowship prints a report to the command line displaying the result. If the validation of any contract is invalid, fellowship raises RestTesterException at the end of the run.
fellowship validate_grpc [-h] path
Positional Arguments¶
- path
The path to contract directory, that contains the contracts that should be validated
generate¶
Generates a Rest contract based on request_kwargs and expected_json at the path given.
fellowship generate [-h] [-s] path request_kwargs expected_json
Positional Arguments¶
- path
The path to were the new contract will be generated
- request_kwargs
A dictionary that contains the request kwargs to generate a new contract. Fields: url, method are required. While fields: data, headers and params are optional
- expected_json
An example of the expected json response to the request kwargs provided. This is used for generating the contract, the values of the fields will not matter. Since the contract will by default only validate the existence and type of the fields
Named Arguments¶
- -s, --strict
Set flag when running generation in strict mode. Strict mode will generate contract with expected value for each field.
Default: False
generate_grpc¶
Generates all gRPC contract based on a proto file to the directory given in path argument. Contracts name will consist of package endpoint function.
fellowship generate_grpc [-h] path proto_file
Positional Arguments¶
- path
The output directory to store the gRPC contracts generated
- proto_file
The proto that generation will be based on. Generates contracts for all endpoints, one contract per function.