Change test_containers unit test to work around webtest issue
The test_should_raise_container_no_content_type_header() is
misnamed. In this test, the Content-type: header is sent, but
there is no value sent with it.
When webtest processed this request with Python3, it hit an infamous
sting/bytes issue while sending the POST. The issue was hit in webtest
and cgi code, not in Barbican code.
From a Barbican point of view, testing Content-type: \r\n
and Content-type: bad_content_type\r\n
runs through the same code, fails the same test, and throws the
same exception.
Therefore, I propose we rename and change the test case to the second
case. Webtest does not have a problem handling this test in Python3.
The same conditions are tested and verified for Python2 and 3.
Reviewed: https:/ /review. openstack. org/219774 /git.openstack. org/cgit/ openstack/ barbican/ commit/ ?id=c4d662c4077 479e22ca7e40d65 8eecb499f4d718
Committed: https:/
Submitter: Jenkins
Branch: master
commit c4d662c4077479e 22ca7e40d658eec b499f4d718
Author: Dave McCowan <email address hidden>
Date: Wed Sep 2 12:05:20 2015 -0400
Change test_containers unit test to work around webtest issue
The test_should_ raise_container _no_content_ type_header( ) is
misnamed. In this test, the Content-type: header is sent, but
there is no value sent with it.
When webtest processed this request with Python3, it hit an infamous
sting/bytes issue while sending the POST. The issue was hit in webtest
and cgi code, not in Barbican code.
From a Barbican point of view, testing
Content- type: \r\n
Content- type: bad_content_ type\r\ n
and
runs through the same code, fails the same test, and throws the
same exception.
Therefore, I propose we rename and change the test case to the second
case. Webtest does not have a problem handling this test in Python3.
The same conditions are tested and verified for Python2 and 3.
Change-Id: I22d597e61fc37d 24526e4dac55498 3108ceaa507 blueprint: blueprint barbican-py3
Related-
Closes-bug: #1485452