replace pdbs with NotImplemented

This commit is contained in:
Steve Pulec 2013-02-25 23:21:49 -05:00
parent 1b3eca72b0
commit 757c45c659
3 changed files with 14 additions and 2 deletions

View File

@ -44,7 +44,7 @@ def bucket_response(uri, body, headers):
template = Template(S3_DELETE_BUCKET_WITH_ITEMS_ERROR) template = Template(S3_DELETE_BUCKET_WITH_ITEMS_ERROR)
return template.render(bucket=removed_bucket), dict(status=409) return template.render(bucket=removed_bucket), dict(status=409)
else: else:
import pdb;pdb.set_trace() raise NotImplementedError("Method {} has not been impelemented in the S3 backend yet".format(method))
def key_response(uri_info, body, headers): def key_response(uri_info, body, headers):
@ -85,7 +85,7 @@ def key_response(uri_info, body, headers):
template = Template(S3_DELETE_OBJECT_SUCCESS) template = Template(S3_DELETE_OBJECT_SUCCESS)
return template.render(bucket=removed_key), dict(status=204) return template.render(bucket=removed_key), dict(status=204)
else: else:
import pdb;pdb.set_trace() raise NotImplementedError("Method {} has not been impelemented in the S3 backend yet".format(method))
S3_ALL_BUCKETS = """<ListAllMyBucketsResult xmlns="http://s3.amazonaws.com/doc/2006-03-01"> S3_ALL_BUCKETS = """<ListAllMyBucketsResult xmlns="http://s3.amazonaws.com/doc/2006-03-01">

View File

@ -5,4 +5,5 @@ freezegun
Jinja2 Jinja2
mock mock
nose nose
requests
sure sure

View File

@ -1,6 +1,7 @@
import boto import boto
from boto.exception import S3ResponseError from boto.exception import S3ResponseError
from boto.s3.key import Key from boto.s3.key import Key
import requests
import sure import sure
@ -90,3 +91,13 @@ def test_get_all_buckets():
buckets = conn.get_all_buckets() buckets = conn.get_all_buckets()
buckets.should.have.length_of(2) buckets.should.have.length_of(2)
@mock_s3
def test_bucket_method_not_implemented():
requests.post.when.called_with("https://foobar.s3.amazonaws.com/").should.throw(NotImplementedError)
@mock_s3
def test_key_method_not_implemented():
requests.post.when.called_with("https://foobar.s3.amazonaws.com/foo").should.throw(NotImplementedError)