windows: use ON_WINDOWS and $SYSTEMROOT in tests

This commit is contained in:
Robert W. Brewer 2015-05-12 03:14:36 -04:00
parent f5e9cbcd5d
commit 0ba6ad3f10

View file

@ -3,9 +3,9 @@ from __future__ import unicode_literals, print_function
import os
import sys
import ast
import platform
from xonsh.execer import Execer
from xonsh.tools import ON_WINDOWS
from tools import mock_xonsh_env
@ -42,9 +42,11 @@ def check_parse(input):
# Tests
#
if platform.system() == 'Windows':
if ON_WINDOWS:
def test_win_ipconfig():
yield check_eval, 'C:\\Windows\\System32\\ipconfig.exe /all'
yield check_eval, os.path.join(os.environ['SYSTEMROOT'],
'System32',
'ipconfig.exe') + ' /all'
def test_ipconfig():
yield check_eval, 'ipconfig /all'