S3 Mock should return an HTTP 409 if trying to create a bucket that

already exists. Closes #94.
This commit is contained in:
Steve Pulec 2014-03-16 21:25:14 -04:00
commit 60cd79c6e2
6 changed files with 33 additions and 16 deletions

View file

@ -20,20 +20,20 @@ def test_s3_server_bucket_create():
backend = server.create_backend_app("s3")
test_client = backend.test_client()
res = test_client.put('/', 'http://foobar.localhost:5000/')
res = test_client.put('/', 'http://foobaz.localhost:5000/')
res.status_code.should.equal(200)
res = test_client.get('/')
res.data.should.contain('<Name>foobar</Name>')
res.data.should.contain('<Name>foobaz</Name>')
res = test_client.get('/', 'http://foobar.localhost:5000/')
res = test_client.get('/', 'http://foobaz.localhost:5000/')
res.status_code.should.equal(200)
res.data.should.contain("ListBucketResult")
res = test_client.put('/bar', 'http://foobar.localhost:5000/', data='test value')
res = test_client.put('/bar', 'http://foobaz.localhost:5000/', data='test value')
res.status_code.should.equal(200)
res = test_client.get('/bar', 'http://foobar.localhost:5000/')
res = test_client.get('/bar', 'http://foobaz.localhost:5000/')
res.status_code.should.equal(200)
res.data.should.equal("test value")
@ -42,14 +42,14 @@ def test_s3_server_post_to_bucket():
backend = server.create_backend_app("s3")
test_client = backend.test_client()
res = test_client.put('/', 'http://foobar.localhost:5000/')
res = test_client.put('/', 'http://tester.localhost:5000/')
res.status_code.should.equal(200)
test_client.post('/', "https://foobar.localhost:5000/", data={
test_client.post('/', "https://tester.localhost:5000/", data={
'key': 'the-key',
'file': 'nothing'
})
res = test_client.get('/the-key', 'http://foobar.localhost:5000/')
res = test_client.get('/the-key', 'http://tester.localhost:5000/')
res.status_code.should.equal(200)
res.data.should.equal("nothing")