diff options
author | Chmouel Boudjnah <chmouel@enovance.com> | 2013-11-29 22:59:27 +0100 |
---|---|---|
committer | Chmouel Boudjnah <chmouel@enovance.com> | 2013-12-06 13:28:01 +0100 |
commit | 983988093f3848671cb27b3c1956e4ca62087dff (patch) | |
tree | bd77fb1360d85c554ee3aa3176d48039601d6b6a /tests/test_swiftclient.py | |
parent | 0ef054585a93f80ba4bc72f953f832372e65db60 (diff) | |
download | python-swiftclient-983988093f3848671cb27b3c1956e4ca62087dff.tar.gz |
Don't crash when header is value of None
Before commit 7d88d14d (http://git.io/hhJWdQ) swifclient used to accept
header value with the type None :
{'Headers': None}
It would just be happy with it with those None headers and not process
them, reinstate the old behavior.
Closes-Bug: 1256441
Change-Id: Ic7f80c38ef2ce9ef1687ed0d6d65521f2e754905
Diffstat (limited to 'tests/test_swiftclient.py')
-rw-r--r-- | tests/test_swiftclient.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/test_swiftclient.py b/tests/test_swiftclient.py index 1c6d3e9..7d58938 100644 --- a/tests/test_swiftclient.py +++ b/tests/test_swiftclient.py @@ -190,6 +190,11 @@ class TestHttpHelpers(MockHttpTest): self.assertRaises(c.InvalidHeadersException, c.validate_headers, headers) + def test_validate_headers_with_other_than_str(self): + for t in (None, 1, 1.0, 1L, u"A"): + self.assertEqual(c.validate_headers({'key': t}), + None) + # TODO: following tests are placeholders, need more tests, better coverage |