-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Guido Barbaglia
committed
Aug 22, 2017
1 parent
720cbc8
commit 2d8915e
Showing
8 changed files
with
70 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
tests/acceptance/version_1/testcases/response/headers/header_value_is_different_case.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from pact_test.either import Left | ||
from pact_test.models.response import PactResponse | ||
from pact_test.matchers.response_matcher import match | ||
from tests.acceptance.acceptance_test_loader import load_acceptance_test | ||
|
||
|
||
def test_different_value_case(): | ||
data = load_acceptance_test(__file__) | ||
|
||
response = PactResponse(headers=[('Accept', 'Alligators')]) | ||
interaction = {'response': {'headers': data['expected']['headers']}} | ||
test_result = match(interaction, response) | ||
|
||
assert type(test_result) is Left |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
.../version_1/testcases/response/headers/order_of_comma_separated_header_values_different.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from pact_test.either import Left | ||
from pact_test.models.response import PactResponse | ||
from pact_test.matchers.response_matcher import match | ||
from tests.acceptance.acceptance_test_loader import load_acceptance_test | ||
|
||
|
||
def test_order_of_headers(): | ||
data = load_acceptance_test(__file__) | ||
|
||
response = PactResponse(headers=[('Accept', 'hippos, alligators')]) | ||
interaction = {'response': {'headers': data['expected']['headers']}} | ||
test_result = match(interaction, response) | ||
|
||
assert type(test_result) is Left |
14 changes: 14 additions & 0 deletions
14
tests/acceptance/version_1/testcases/response/headers/unexpected_header_found.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from pact_test.either import Right | ||
from pact_test.models.response import PactResponse | ||
from pact_test.matchers.response_matcher import match | ||
from tests.acceptance.acceptance_test_loader import load_acceptance_test | ||
|
||
|
||
def test_unexpected_header(): | ||
data = load_acceptance_test(__file__) | ||
|
||
response = PactResponse(headers=[('Accept', 'alligators')]) | ||
interaction = {'response': {'headers': data['expected']['headers']}} | ||
test_result = match(interaction, response) | ||
|
||
assert type(test_result) is Right |
14 changes: 14 additions & 0 deletions
14
tests/acceptance/version_1/testcases/response/headers/whitespace_after_comma_different.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from pact_test.either import Right | ||
from pact_test.models.response import PactResponse | ||
from pact_test.matchers.response_matcher import match | ||
from tests.acceptance.acceptance_test_loader import load_acceptance_test | ||
|
||
|
||
def test_whitespaces_after_comma(): | ||
data = load_acceptance_test(__file__) | ||
|
||
response = PactResponse(headers=[('Accept', 'alligators, hippos')]) | ||
interaction = {'response': {'headers': data['expected']['headers']}} | ||
test_result = match(interaction, response) | ||
|
||
assert type(test_result) is Right |