-
Notifications
You must be signed in to change notification settings - Fork 138
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
1 parent
e7d686a
commit cbf8ea0
Showing
10 changed files
with
105 additions
and
80 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
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,21 @@ | ||
"""Custom Pact Exception.""" | ||
|
||
class PactException(Exception): | ||
"""PactException when input isn't valid. | ||
Args: | ||
Exception ([type]): [description] | ||
Raises: | ||
KeyError: [description] | ||
Exception: [description] | ||
Returns: | ||
[type]: [description] | ||
""" | ||
|
||
def __init__(self, *args, **kwargs): | ||
"""Create wrapper.""" | ||
super().__init__(*args, **kwargs) | ||
self.message = args[0] |
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
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 |
---|---|---|
@@ -1,4 +1,19 @@ | ||
import pytest | ||
import mock | ||
|
||
from pact.pact_exception import PactException | ||
from pact.ffi.ffi_verifier import FFIVerify | ||
|
||
def test_version(): | ||
assert FFIVerify().version() == "0.0.0" | ||
|
||
|
||
@mock.patch("os.listdir") | ||
def test_pact_urls_or_broker_required(mock_Popen): | ||
# mock_Popen.return_value.returncode = 2 | ||
verifier = FFIVerify() | ||
|
||
with assertRaises(PactException) as context: | ||
verifier.verify(provider='provider', provider_base_url='http://localhost') | ||
|
||
assert 'Pact urls or Pact broker required' in context.exception.message |
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