summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChuck Short <chucks@redhat.com>2018-08-24 08:05:59 -0400
committerNguyen Hai <nguyentrihai93@gmail.com>2018-09-22 06:53:52 +0000
commit3f665f33098cd960e932658d2c614020019c99ee (patch)
treeb61951e1bf09199115edbdd8f67e4cd86834b3f2
parent695d6726f8b66ecdda5676fde4e0e989813a8cd4 (diff)
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>
Notes
Notes (review): Code-Review+1: Nguyen Hai <nguyentrihai93@gmail.com> Code-Review+2: Jiao Pengju <jiaopengju@cmss.chinamobile.com> Code-Review+1: Sean McGinnis <sean.mcginnis@gmail.com> Workflow+1: Jiao Pengju <jiaopengju@cmss.chinamobile.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Sun, 23 Sep 2018 09:15:27 +0000 Reviewed-on: https://review.openstack.org/596289 Project: openstack/karbor Branch: refs/heads/master
-rw-r--r--karbor/tests/unit/api/test_api_validation.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/karbor/tests/unit/api/test_api_validation.py b/karbor/tests/unit/api/test_api_validation.py
index 1821441..4ccc60c 100644
--- a/karbor/tests/unit/api/test_api_validation.py
+++ b/karbor/tests/unit/api/test_api_validation.py
@@ -11,7 +11,6 @@
11# under the License. 11# under the License.
12 12
13import re 13import re
14import sys
15 14
16import fixtures 15import fixtures
17import six 16import six
@@ -234,7 +233,7 @@ class PatternPropertiesTestCase(APIValidationTestCase):
234 self.check_validation_error(self.post, body={'0123456789a': 'bar'}, 233 self.check_validation_error(self.post, body={'0123456789a': 'bar'},
235 expected_detail=details) 234 expected_detail=details)
236 235
237 if sys.version[:3] == '3.5': 236 if six.PY3:
238 detail = "expected string or bytes-like object" 237 detail = "expected string or bytes-like object"
239 else: 238 else:
240 detail = "expected string or buffer" 239 detail = "expected string or buffer"