Skip to content
Snippets Groups Projects
Commit f4d6cca4 authored by Gavin M. Roy's avatar Gavin M. Roy
Browse files

Make sure the right exception is raised when an error is encountered

parent 22b6079a
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -4,7 +4,7 @@ import os
import unittest
import uuid
 
from tornado import testing
from tornado import httpclient, testing
 
try:
from tornado import curl_httpclient
Loading
Loading
@@ -107,3 +107,17 @@ class UseCurlDynamoDBTestCase(DynamoDBTestCase):
@unittest.skipIf(curl_httpclient is None, 'pycurl not installed')
def test_create_table(self):
return super(UseCurlDynamoDBTestCase, self).test_create_table()
@testing.gen_test
@unittest.skipIf(curl_httpclient is None, 'pycurl not installed')
def test_invalid_endpoint(self):
client = tornado_aws.AsyncAWSClient(
'dynamodb', endpoint='http://localhost', use_curl=True)
definition = copy.deepcopy(self.TABLE_DEFINITION)
definition['TableName'] = str(uuid.uuid4())
with self.assertRaises(httpclient.HTTPError):
yield client.fetch(
'POST', '/', body=json.dumps(definition).encode('utf-8'),
headers={
'x-amz-target': 'DynamoDB_20120810.CreateTable',
'Content-Type': 'application/x-amz-json-1.0'})
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment