Fix appveyor and windows. Resolves #293

This commit is contained in:
Anthony Sottile
2015-11-23 20:10:08 -08:00
parent 1cdbe38b5f
commit 248930f6dc
7 changed files with 60 additions and 34 deletions

View File

@@ -0,0 +1,18 @@
from __future__ import absolute_import
from __future__ import unicode_literals
import os.path
from pre_commit.languages import python
def test_norm_version_expanduser():
home = os.path.expanduser('~')
if os.name == 'nt': # pragma: no cover (nt)
path = r'~\python343'
expected_path = r'{0}\python343'.format(home)
else: # pragma: no cover (non-nt)
path = '~/.pyenv/versions/3.4.3/bin/python'
expected_path = home + '/.pyenv/versions/3.4.3/bin/python'
result = python.norm_version(path)
assert result == expected_path