mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-01-13 12:30:08 -06:00
19 lines
572 B
Python
19 lines
572 B
Python
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'{}\python343'.format(home)
|
|
else: # pragma: windows no cover
|
|
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
|