-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Labels
Description
Description
The put function in the code example provided in marbles.core.TestCase is indented strangely.
import requests
import marbles.core
def put(cls, endpoint, data=None):
return Response(status_code=409,
reason=('The request could not be completed '
'due to a conflict with the current '
'state of the target resource.'))
class ResponseTestCase(marbles.core.TestCase):
def test_create_resource(self):
endpoint = 'http://example.com/api/v1/resource'
data = {'id': 1, 'name': 'Little Bobby Tables'}
res = requests.put(endpoint, data=data)
self.assertEqual(
res.status_code,
201,
note=res.reasonIntended audience
Users
Additional context
A better-motivated example would be appropriate here:
- tests shouldn't be hitting external services
- this example doesn't demonstrate the advantage of capturing more information about the test author's intent