def test_16_unknown_exception_delete(self): ''' Tests the DELETE request with an unknown error ''' bad_rest_client = RestClient(RestClient(), 2, 3) success, response = \ bad_rest_client.delete_request(self.test_sample_from_portion, self.test_sample_select_portion) # Test that the request contents came back as expected assert success == False assert response == "An unidentified error has occured: unsupported operand type(s) for +: 'RestClient' and 'int'."
def test_15_connection_error_delete(self): ''' Tests the DELETE request with a connection error. ''' # Try making the request, but with a bad url bad_rest_client = RestClient("http://", "255.255.255.255", "22") success, response = \ bad_rest_client.delete_request(self.test_sample_from_portion, self.test_sample_select_portion) # Test that the request contents came back as expected assert success == False assert response == "A connection error has occured."