tests: harden tests for handling universal line endings

Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:
Mihai Tudor Panu 2017-06-12 20:38:10 -07:00
parent 874eacf12e
commit 0cb7d3f9b4
2 changed files with 4 additions and 4 deletions

View File

@ -29,7 +29,7 @@ class AutoLoadLibrary(u.TestCase):
moduleName = fileName[:-2]
snippet = prefix + moduleName + suffix
with open(os.path.join(subdir, fileName), "r") as f:
with open(os.path.join(subdir, fileName), "rU") as f:
#read in entire file
data = f.read()
#Make sure it is module

View File

@ -14,7 +14,7 @@ class BlacklistConsistency(u.TestCase):
def test_java_blacklist(self):
with open(javaBlacklistFile) as f:
blacklist = [line.rstrip('\n') for line in f]
blacklist = [line.rstrip('\r\n') for line in f]
for libraryName in blacklist:
files = os.listdir( os.path.join(rootDir, libraryName))
@ -29,7 +29,7 @@ class BlacklistConsistency(u.TestCase):
def test_python_blacklist(self):
with open(pythonBlacklistFile) as f:
blacklist = [line.rstrip('\n') for line in f]
blacklist = [line.rstrip('\r\n') for line in f]
for libraryName in blacklist:
files = os.listdir( os.path.join(rootDir, libraryName))
@ -44,7 +44,7 @@ class BlacklistConsistency(u.TestCase):
def test_node_blacklist(self):
with open(nodeBlacklistFile) as f:
blacklist = [line.rstrip('\n') for line in f]
blacklist = [line.rstrip('\r\n') for line in f]
for libraryName in blacklist:
files = os.listdir( os.path.join(rootDir, libraryName))