Merge "tests: Use format=plain instead of format=txt"
This commit is contained in:
3 changed files with 15 additions and 15 deletions
@@ -66,8 +66,8 @@ const expectedWithDelimiter = [
]
runTests('container', [
['GET format=txt',
() => MakeRequest('GET', 'public-with-cors', {}, '', {'format': 'txt'})
['GET format=plain',
() => MakeRequest('GET', 'public-with-cors', {}, '', {'format': 'plain'})
.then(HasStatus(200, 'OK'))
.then(HasCommonResponseHeaders)
.then(HasHeaders({ 'Content-Type': 'text/plain; charset=utf-8' }))
@@ -130,8 +130,8 @@ runTests('container', [
throw new Error('Expected response to start with ' + JSON.stringify(prefix) + '; got ' + resp.responseText)
}
})],
['HEAD format=txt',
() => MakeRequest('HEAD', 'public-with-cors', {}, '', {'format': 'txt'})
['HEAD format=plain',
() => MakeRequest('HEAD', 'public-with-cors', {}, '', {'format': 'plain'})
.then(HasStatus200Or204)
.then(HasHeaders({ 'Content-Type': 'text/plain; charset=utf-8' }))
.then(HasNoBody)],
@@ -74,7 +74,7 @@ class TestListingFormats(unittest.TestCase):
self.assertEqual(self.fake_swift.calls[-1], (
'GET', '/v1/a?format=json'))
req = Request.blank('/v1/a?format=txt')
req = Request.blank('/v1/a?format=plain')
resp = req.get_response(self.app)
self.assertEqual(resp.body, b'bar\nfoo_\n')
self.assertEqual(resp.headers['Content-Type'],
@@ -271,7 +271,7 @@ class TestListingFormats(unittest.TestCase):
self.assertEqual(self.fake_swift.calls[-1], (
'GET', '/v1/a\xe2\x98\x83?format=json'))
req = Request.blank('/v1/a\xe2\x98\x83?format=txt')
req = Request.blank('/v1/a\xe2\x98\x83?format=plain')
resp = req.get_response(self.app)
self.assertEqual(resp.body, b'bar\nfoo_\n')
self.assertEqual(resp.headers['Content-Type'],
@@ -279,7 +279,7 @@ class TestListingFormats(unittest.TestCase):
self.assertEqual(self.fake_swift.calls[-1], (
'GET', '/v1/a\xe2\x98\x83?format=json'))
req = Request.blank('/v1/a\xe2\x98\x83?format=txt', headers={
req = Request.blank('/v1/a\xe2\x98\x83?format=plain', headers={
'X-Backend-Allow-Reserved-Names': 'true'})
resp = req.get_response(self.app)
self.assertEqual(resp.body, b'bar\n%s\nfoo_\n%s\n' % (
@@ -363,7 +363,7 @@ class TestListingFormats(unittest.TestCase):
self.assertEqual(self.fake_swift.calls[-1], (
'GET', '/v1/a/c?format=json'))
req = Request.blank('/v1/a/c?format=txt')
req = Request.blank('/v1/a/c?format=plain')
resp = req.get_response(self.app)
self.assertEqual(resp.body, b'bar\nfoo/\n')
self.assertEqual(resp.headers['Content-Type'],
@@ -433,7 +433,7 @@ class TestListingFormats(unittest.TestCase):
self.assertEqual(self.fake_swift.calls[-1], (
'GET', path + '?format=json'))
req = Request.blank(path + '?format=txt')
req = Request.blank(path + '?format=plain')
resp = req.get_response(self.app)
self.assertEqual(resp.body, b'bar\nfoo/\n')
self.assertEqual(resp.headers['Content-Type'],
@@ -441,7 +441,7 @@ class TestListingFormats(unittest.TestCase):
self.assertEqual(self.fake_swift.calls[-1], (
'GET', path + '?format=json'))
req = Request.blank(path + '?format=txt', headers={
req = Request.blank(path + '?format=plain', headers={
'X-Backend-Allow-Reserved-Names': 'true'})
resp = req.get_response(self.app)
self.assertEqual(resp.body, b'bar\n%s\nfoo/\n%s\n' % (
@@ -531,7 +531,7 @@ class TestListingFormats(unittest.TestCase):
self.assertEqual(self.fake_swift.calls[-1], (
'GET', '/v1/a?format=json'))
req = Request.blank('/v1/a?format=txt')
req = Request.blank('/v1/a?format=plain')
resp = req.get_response(self.app)
self.assertEqual(resp.status, '204 No Content')
self.assertEqual(resp.body, b'')
@@ -575,7 +575,7 @@ class TestListingFormats(unittest.TestCase):
self.assertEqual(self.fake_swift.calls[-1], (
'GET', '/v1/a/c?format=json'))
req = Request.blank('/v1/a/c?format=txt')
req = Request.blank('/v1/a/c?format=plain')
resp = req.get_response(self.app)
self.assertEqual(resp.status, '204 No Content')
self.assertEqual(resp.body, b'')
@@ -697,7 +697,7 @@ class TestListingFormats(unittest.TestCase):
'GET', '/v1/staticweb/bad-json?format=json'))
do_sub_test('/v1/staticweb/bad-json')
do_sub_test('/v1/staticweb/bad-json?format=txt')
do_sub_test('/v1/staticweb/bad-json?format=plain')
do_sub_test('/v1/staticweb/bad-json?format=xml')
do_sub_test('/v1/staticweb/bad-json?format=json')
@@ -731,7 +731,7 @@ class TestListingFormats(unittest.TestCase):
'GET', '/v1/staticweb/bad-json?format=json'))
do_test('/v1/staticweb/bad-json')
do_test('/v1/staticweb/bad-json?format=txt')
do_test('/v1/staticweb/bad-json?format=plain')
do_test('/v1/staticweb/bad-json?format=xml')
# The response we get is *just close enough* to being valid that we
# assume it is and slap on the missing charset. If you set up staticweb
@@ -2495,7 +2495,7 @@ class ObjectVersioningTestContainerOperations(ObjectVersioningBaseTestCase):
# But everything else is unacceptable
req = Request.blank(
'/v1/a/c?versions&format=txt',
'/v1/a/c?versions&format=plain',
environ={'REQUEST_METHOD': 'GET',
'swift.cache': self.cache_version_on})
status, headers, body = self.call_ov(req)
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.