Skip to content

Instantly share code, notes, and snippets.

@Kalimaha
Last active December 10, 2017 04:09
Show Gist options
  • Select an option

  • Save Kalimaha/ba1a9cd9c47e9303507fd06ee4e260d3 to your computer and use it in GitHub Desktop.

Select an option

Save Kalimaha/ba1a9cd9c47e9303507fd06ee4e260d3 to your computer and use it in GitHub Desktop.
@service_consumer('Sous Chef')
@has_pact_with('Grill Chef')
class GrillChefTest(ServiceProviderTest):
@given('steaks are available')
@upon_receiving('a request for a steak')
@with_request({'method': 'POST', 'path': '/steaks/', 'body': {'cooking': 'medium-rare'}})
@will_respond_with({'status': 201, 'body': {'waitingTime': 10}})
def test_steak(self):
response = GrillChefRepository.steak('medium-rare')
assert response['waitingTime'] == 10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment