Skip to content

Commit

Permalink
[FAB-4969] Allow for failure response from a peer
Browse files Browse the repository at this point in the history
This step allows for the verification of an error
response from a peer for use in behave tests
defined in feature files under fabric/test/feature/.

Change-Id: I7cb5e064a43c3dff31642601b35bf4c6c6cac4ee
Signed-off-by: Latitia M Haskins <[email protected]>
  • Loading branch information
lhaskins committed Jun 28, 2017
1 parent 5113c94 commit c1d7f9e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/feature/steps/endorser_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,11 @@ def expected_impl(context, response, peer):
assert peer in context.result, "There is no response from {0}".format(peer)
assert context.result[peer] == "Query Result: {0}\n".format(response), "Expected response was {0}; received {1}".format(response, context.result[peer])

@then(u'a user receives an error response of {response} from "{peer}"')
def step_impl(context, response, peer):
assert peer in context.result, "There is no response from {0}".format(peer)
assert context.result[peer] == "Error: {0}\n".format(response), "Expected response was {0}; received {1}".format(response, context.result[peer])

@then(u'a user receives expected response of {response}')
def step_impl(context, response):
expected_impl(context, response, "peer0.org1.example.com")

0 comments on commit c1d7f9e

Please sign in to comment.