Skip to content

Commit b0ec933

Browse files
authored
feat: added support for message provider using pact broker
2 parents 7c348a8 + a4803fa commit b0ec933

23 files changed

Lines changed: 694 additions & 291 deletions

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# pact-python specific ignores
22
e2e/pacts
33
userserviceclient-userservice.json
4+
detectcontentlambda-contentprovider.json
45
pact/bin
56

67
# Byte-compiled / optimized / DLL files

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
### 1.4.2
2+
* f2230b6 - chore: Bundle Ruby standalones into dist artifact. (#256) (Taj Pereira, Sun Aug 22 19:53:53 2021 +0930)
3+
* e370786 - chore: Releasing version 1.4.1 (Elliott Murray, Tue Aug 17 18:55:53 2021 +0100)
4+
* 7dc8864 - fix: make uvicorn versions over 0.14 (#255) (Elliott Murray, Tue Aug 17 18:51:52 2021 +0100)
5+
* da49cd7 - chore: Releasing version 1.4.0 (Elliott Murray, Sat Aug 7 10:17:26 2021 +0100)
6+
* 0089937 - fix: issue originating from snyk with requests and urllib (#252) (Elliott Murray, Sat Jul 31 12:46:15 2021 +0100)
7+
* 903371b - feat: added support for message provider (#251) (Fabio Pulvirenti, Sat Jul 31 13:24:19 2021 +0200)
8+
* 2c81029 - chore(snyk): update fastapi (#239) (Elliott Murray, Fri Jun 11 09:12:38 2021 +0100)
9+
### 1.4.1
10+
* 7dc8864 - fix: make uvicorn versions over 0.14 (#255) (Elliott Murray, Tue Aug 17 18:51:52 2021 +0100)
11+
### 1.4.0
12+
* 0089937 - fix: issue originating from snyk with requests and urllib (#252) (Elliott Murray, Sat Jul 31 12:46:15 2021 +0100)
13+
* 903371b - feat: added support for message provider (#251) (Fabio Pulvirenti, Sat Jul 31 13:24:19 2021 +0200)
14+
* 2c81029 - chore(snyk): update fastapi (#239) (Elliott Murray, Fri Jun 11 09:12:38 2021 +0100)
15+
### 1.3.9
16+
* 98d9a4b - chore(ruby): update ruby standalen (#233) (Elliott Murray, Thu May 13 20:21:10 2021 +0100)
17+
* 657e770 - fix: change default from empty string to empty list (#235) (Vasile Tofan, Thu May 13 22:20:47 2021 +0300)
18+
* 99fd965 - chore: Releasing version 1.3.8 (Elliott Murray, Sat May 1 12:26:47 2021 +0100)
19+
* 3c909f1 - docs: example uses date matcher (#231) (Elliott Murray, Sat May 1 11:51:28 2021 +0100)
20+
* 6390144 - fix: fix datetime serialization issues in Format (#230) (Syed Muhammad Dawoud Sheraz Ali, Thu Apr 29 01:49:53 2021 +0500)
121
### 1.3.8
222
* 3c909f1 - docs: example uses date matcher (#231) (Elliott Murray, Sat May 1 11:51:28 2021 +0100)
323
* 6390144 - fix: fix datetime serialization issues in Format (#230) (Syed Muhammad Dawoud Sheraz Ali, Thu Apr 29 01:49:53 2021 +0500)

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
include LICENSE
22
include *.txt
33
include *.md
4+
include pact/bin/*
45
prune pact/test
5-
prune pact/bin
66
prune e2e

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ To setup a development environment:
437437
1. If you want to run tests for all Python versions, install 2.7, 3.3, 3.4, 3.5, and 3.6 from source or using a tool like [pyenv]
438438
2. Its recommended to create a Python [virtualenv] for the project
439439

440-
The setup the environment, run tests, and package the application, run:
440+
To setup the environment, run tests, and package the application, run:
441441
`make release`
442442

443443
If you are just interested in packaging pact-python so you can install it using pip:
@@ -449,6 +449,15 @@ From there you can use pip to install it:
449449

450450
`pip install ./dist/pact-python-N.N.N.tar.gz`
451451

452+
## Offline Installation of Standalone Packages
453+
454+
Although all Ruby standalone applications are predownloaded into the wheel artifact, it may be useful, for development, purposes to install custom Ruby binaries. In which case, use the `bin-path` flag.
455+
```
456+
pip install pact-python --bin-path=/absolute/path/to/folder/containing/pact/binaries/for/your/os
457+
```
458+
459+
Pact binaries can be found at [Pact Ruby Releases](https://github.com/pact-foundation/pact-ruby-standalone/releases).
460+
452461
## Testing
453462

454463
This project has unit and end to end tests, which can both be run from make:

examples/fastapi_e2e/Pipfile

Lines changed: 0 additions & 15 deletions
This file was deleted.

examples/fastapi_e2e/Pipfile.lock

Lines changed: 0 additions & 210 deletions
This file was deleted.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
fastapi==0.61.2
1+
fastapi==0.65.2
22
pytest==5.4.1
33
requests==2.23.0
44
uvicorn==0.12.3

examples/message/README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class MessageHandler(object):
4141
```
4242

4343
Below is a snippet from a test where the message handler has no error.
44-
Since the expected event contains a key `documentType` with value `microsoft-word`, message handler does not throw an error and a pact file `f"pacts/{expected_json}"` is expected to be generated.
44+
Since the expected event contains a key `documentType` with value `microsoft-word`, message handler does not throw an error and a pact file `f"{PACT_FILE}""` is expected to be generated.
4545

4646
```python
4747
def test_generate_new_pact_file(pact):
@@ -69,7 +69,7 @@ def test_generate_new_pact_file(pact):
6969
assert isfile(f"{PACT_FILE}") == 1
7070
```
7171

72-
For a similar test where the event does not contain a key `documentType` with value `microsoft-word`, a `CustomError` is generated and there there is no generated json file `f"pacts/{expected_json}"`.
72+
For a similar test where the event does not contain a key `documentType` with value `microsoft-word`, a `CustomError` is generated and there there is no generated json file `f"{PACT_FILE}"`.
7373

7474
```python
7575
def test_throw_exception_handler(pact):
@@ -97,8 +97,6 @@ def test_throw_exception_handler(pact):
9797
assert isfile(f"{PACT_FILE}") == 0
9898
```
9999

100-
Otherwise, no pact file is generated.
101-
102100
## Provider
103101

104102
Note: The current example only tests the consumer side.

0 commit comments

Comments
 (0)