py36: Fix unit tests
Unit tests were only working on py35 and not py36, this is because the unit test in test_api_validations were only checking for py35. Use the six library to detect the python version used. Change-Id: Iab10228e911a9efc0e18b04667596342ee949642 Signed-off-by: Chuck Short <chucks@redhat.com>
This commit is contained in:
parent
695d6726f8
commit
3f665f3309
@ -11,7 +11,6 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import re
|
import re
|
||||||
import sys
|
|
||||||
|
|
||||||
import fixtures
|
import fixtures
|
||||||
import six
|
import six
|
||||||
@ -234,7 +233,7 @@ class PatternPropertiesTestCase(APIValidationTestCase):
|
|||||||
self.check_validation_error(self.post, body={'0123456789a': 'bar'},
|
self.check_validation_error(self.post, body={'0123456789a': 'bar'},
|
||||||
expected_detail=details)
|
expected_detail=details)
|
||||||
|
|
||||||
if sys.version[:3] == '3.5':
|
if six.PY3:
|
||||||
detail = "expected string or bytes-like object"
|
detail = "expected string or bytes-like object"
|
||||||
else:
|
else:
|
||||||
detail = "expected string or buffer"
|
detail = "expected string or buffer"
|
||||||
|
Loading…
Reference in New Issue
Block a user