You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: examples/README.md
+6-6
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ Assuming you have [hatch](https://hatch.pypa.io/latest/) installed, the example
8
8
hatch run example
9
9
```
10
10
11
-
The code within the examples is intended to be welldocumented and you are encouraged to look through the code as well (or submit a PR if anything is unclear!).
11
+
The code within the examples is intended to be well-documented and you are encouraged to look through the code as well (or submit a PR if anything is unclear!).
12
12
13
13
## Overview
14
14
@@ -34,7 +34,7 @@ sequenceDiagram
34
34
35
35
To test this interaction naively would require both the consumer and provider to be running at the same time. While this is straightforward in the above example, this quickly becomes impractical as the number of interactions grows between many microservices. Pact solves this by allowing the consumer and provider to be tested independently.
36
36
37
-
Pact achieves this be mocking the other side of the interaction:
37
+
Pact achieves this by mocking the other side of the interaction:
38
38
39
39
<!-- markdownlint-disable no-inline-html -->
40
40
<divalign="center">
@@ -65,7 +65,7 @@ sequenceDiagram
65
65
</div>
66
66
<!-- markdownlint-enable no-inline-html -->
67
67
68
-
In the first stage, the consumer defines a number of interactions in the form below. Pact sets up a mock server that will respond to the requests as defined by the consumer. All these interactions, containing both the request and expected response, are all sent to the Pact Broker.
68
+
In the first stage, the consumer defines a number of interactions in the form below. Pact sets up a mock server that will respond to the requests as defined by the consumer. All these interactions, containing both the request and expected response, are sent to the Pact Broker.
69
69
70
70
> Given {provider state} </br>
71
71
> Upon receiving {description} </br>
@@ -74,7 +74,7 @@ In the first stage, the consumer defines a number of interactions in the form be
74
74
75
75
In the second stage, the provider retrieves the interactions from the Pact Broker. It then sets up a mock client that will make the requests as defined by the consumer. Pact then verifies that the responses from the provider match the expected responses defined by the consumer.
76
76
77
-
In this way, Pact is consumerdriven and can ensure that the provider is compatible with the consumer. While this example showcases both sides in Python, this is absolutely not required. The provider could be written in any language, and satisfy contracts from a number of consumers all written in different languages.
77
+
In this way, Pact is consumer-driven and can ensure that the provider is compatible with the consumer. While this example showcases both sides in Python, this is absolutely not required. The provider could be written in any language, and satisfy contracts from a number of consumers all written in different languages.
78
78
79
79
### Consumer
80
80
@@ -97,9 +97,9 @@ expected: dict[str, Any] = {
97
97
98
98
### Provider
99
99
100
-
This example showcases to different providers, one written in Flask and one written in FastAPI. Both are simple Python web servers that respond to a HTTP GET request. The Flask provider is defined in [`src/flask.py`][examples.src.flask] and the FastAPI provider is defined in [`src/fastapi.py`][examples.src.fastapi]. The tests for the providers are defined in [`tests/test_01_provider_flask.py`][examples.tests.test_01_provider_flask] and [`tests/test_01_provider_fastapi.py`][examples.tests.test_01_provider_fastapi].
100
+
This example showcases two different providers; one written in Flask and one written in FastAPI. Both are simple Python web servers that respond to a HTTP GET request. The Flask provider is defined in [`src/flask.py`][examples.src.flask] and the FastAPI provider is defined in [`src/fastapi.py`][examples.src.fastapi]. The tests for the providers are defined in [`tests/test_01_provider_flask.py`][examples.tests.test_01_provider_flask] and [`tests/test_01_provider_fastapi.py`][examples.tests.test_01_provider_fastapi].
101
101
102
-
Unlike the consumer side, the provider side is responsible to responding to the interactions defined by the consumers. In this regard, the provider testing is rather simple:
102
+
Unlike the consumer side, the provider side is responsible for responding to the interactions defined by the consumers. In this regard, the provider testing is rather simple:
0 commit comments