tests: adjust for windows incompatibilities

Windows does a few things differently. Deal with it.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
This commit is contained in:
Martí Bolívar 2019-11-15 15:42:04 -08:00 committed by Carles Cufí
parent 564e1d4659
commit ae784d516d
1 changed files with 13 additions and 1 deletions

View File

@ -2,6 +2,9 @@
# Test cases
#
import os
import sys
from west.main import BUILTIN_COMMANDS
from conftest import cmd
@ -25,8 +28,17 @@ def test_extension_help_and_dash_h(west_init_tmpdir):
cmd('update')
ext1out = cmd('help test-extension')
ext2out = cmd('test-extension -h')
expected = EXTENSION_EXPECTED
if sys.platform == 'win32':
# Manage gratuitous incompatibilities:
#
# - multiline python strings are \n separated even on windows
# - the windows command help output gets an extra newline
expected = os.linesep.join(expected.splitlines()) + os.linesep
assert ext1out == ext2out
assert ext1out == EXTENSION_EXPECTED
assert ext1out == expected
EXTENSION_EXPECTED = '''\