"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "test/unit/common/test_swob.py" between
swift-2.19.1.tar.gz and swift-2.21.0.tar.gz

About: OpenStack swift is software for creating redundant, scalable object storage using clusters of commodity servers to store terabytes or even petabytes of accessible data (now supporting storage policies).
The "Stein" series (latest release).

test_swob.py  (swift-2.19.1):test_swob.py  (swift-2.21.0)
skipping to change at line 562 skipping to change at line 562
self.assertEqual(req.params['c'], 'd') self.assertEqual(req.params['c'], 'd')
new_params = {'e': 'f', 'g': 'h'} new_params = {'e': 'f', 'g': 'h'}
req.params = new_params req.params = new_params
self.assertDictEqual(new_params, req.params) self.assertDictEqual(new_params, req.params)
new_params = (('i', 'j'), ('k', 'l')) new_params = (('i', 'j'), ('k', 'l'))
req.params = new_params req.params = new_params
self.assertDictEqual(dict(new_params), req.params) self.assertDictEqual(dict(new_params), req.params)
def test_unicode_params(self):
# NB: all of these strings are WSGI strings
req = swift.common.swob.Request.blank(
'/?\xe1\x88\xb4=%E1%88%B4&%FF=\xff')
self.assertEqual(req.params['\xff'], '\xff')
self.assertEqual(req.params['\xe1\x88\xb4'], '\xe1\x88\xb4')
new_params = {'\xff': '\xe1\x88\xb4', '\xe1\x88\xb4': '\xff'}
req.params = new_params
self.assertDictEqual(new_params, req.params)
self.assertIn('%FF=%E1%88%B4', req.environ['QUERY_STRING'])
self.assertIn('%E1%88%B4=%FF', req.environ['QUERY_STRING'])
# ...well, until we get to unicode that isn't WSGI-friendly
new_params = ((u'\u1234', u'\u1234'), )
with self.assertRaises(UnicodeEncodeError):
req.params = new_params
def test_timestamp_missing(self): def test_timestamp_missing(self):
req = swift.common.swob.Request.blank('/') req = swift.common.swob.Request.blank('/')
self.assertRaises(exceptions.InvalidTimestamp, self.assertRaises(exceptions.InvalidTimestamp,
getattr, req, 'timestamp') getattr, req, 'timestamp')
def test_timestamp_invalid(self): def test_timestamp_invalid(self):
req = swift.common.swob.Request.blank( req = swift.common.swob.Request.blank(
'/', headers={'X-Timestamp': 'asdf'}) '/', headers={'X-Timestamp': 'asdf'})
self.assertRaises(exceptions.InvalidTimestamp, self.assertRaises(exceptions.InvalidTimestamp,
getattr, req, 'timestamp') getattr, req, 'timestamp')
 End of changes. 1 change blocks. 
0 lines changed or deleted 18 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)