Exemplo n.º 1
0
 def test_ignore_failing_delete_request(self, fake):
     client = Client(raise_for_status=False)
     for status in (500, 501, 502, 504, 505):
         with self.mock_request(fake, status):
             try:
                 client.delete('/path')
                 Client().delete('path')  # test the default version
             except HTTPError:
                 self.fail('client.delete() raises an exception when'
                           '``raise_for_status`` is set to False')
Exemplo n.º 2
0
 def test_delete_request_fails(self, fake):
     client = Client(raise_for_status=True)
     for status in (500, 501, 502, 504, 505):
         with self.mock_request(fake, status):
             self.assertRaises(HTTPError, lambda: client.delete('/path'))