summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlaili <lai.li@zte.com.cn>2018-08-16 14:01:21 +0800
committerlaili <lai.li@zte.com.cn>2018-08-16 14:01:21 +0800
commit4e55eea171d9556802ca96410de7a737e568f94d (patch)
tree9b41af7ff100fe363b2ee848202a7a5bc5cdb672
parent33968547b500867272d5d9ec7aa8cd1919816b46 (diff)
Dealing with test related stuffs.
Fix a bug when running util tests on windows platform. Change-Id: I5419dc48b8501cd94d7283f35508b666a110d6e4 Issue-ID: VFC-1012 Signed-off-by: laili <lai.li@zte.com.cn>
-rw-r--r--lcm/lcm/pub/utils/tests.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/lcm/lcm/pub/utils/tests.py b/lcm/lcm/pub/utils/tests.py
index d7d628e0..87516f07 100644
--- a/lcm/lcm/pub/utils/tests.py
+++ b/lcm/lcm/pub/utils/tests.py
@@ -20,6 +20,7 @@ import urllib2
import syscomm
import timeutil
import values
+import platform
from lcm.pub.database.models import JobStatusModel, JobModel
from lcm.pub.utils.jobutil import JobUtil
@@ -57,7 +58,10 @@ class UtilsTest(unittest.TestCase):
fileutil.delete_dirs("abc")
is_ok, f_name = fileutil.download_file_from_http("1", "abc", "1.txt")
self.assertTrue(is_ok)
- self.assertTrue(f_name.endswith("abc/1.txt"))
+ if platform.system() == 'Windows':
+ self.assertTrue(f_name.endswith("abc\\1.txt"))
+ else:
+ self.assertTrue(f_name.endswith("abc/1.txt"))
fileutil.delete_dirs("abc")
def test_query_job_status(self):