From: Artem Bityutskiy Date: Fri, 20 Sep 2013 10:30:59 +0000 (+0300) Subject: tests: add a Centos 6 work-around X-Git-Tag: v3.0~16 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=02641fc2ff97c65638f4b7b795606e58dfdf49a9;p=tools%2Fbmap-tools.git tests: add a Centos 6 work-around Centos 6 is very old, and it has old unittest library, and the newer one which we need is called 'unittest2' there. This patch adds the corresponding work-around to make our tests pass in Centos 6. Change-Id: Ibf9d9185f23a79aeb2f0ecf67f8f22e1840f1a82 Signed-off-by: Artem Bityutskiy --- diff --git a/tests/test_api_base.py b/tests/test_api_base.py index a1c1f02..34a745a 100644 --- a/tests/test_api_base.py +++ b/tests/test_api_base.py @@ -14,10 +14,15 @@ import sys import tempfile import filecmp import hashlib -import unittest import itertools import random +# This is a work-around for Centos 6 +try: + import unittest2 as unittest +except ImportError: + import unittest + import tests.helpers from bmaptools import BmapCreate, BmapCopy, Fiemap, TransRead diff --git a/tests/test_fiemap.py b/tests/test_fiemap.py index 0c031d2..e9c0a15 100644 --- a/tests/test_fiemap.py +++ b/tests/test_fiemap.py @@ -11,9 +11,15 @@ files and makes sure FIEMAP returns correct information about the holes. import random -import unittest import itertools +# This is a work-around for Centos 6 +try: + import unittest2 as unittest +except ImportError: + import unittest + + import tests.helpers from bmaptools import Fiemap