mirror of
https://github.com/kennethreitz/pipenv.git
synced 2026-06-05 22:50:18 +00:00
3084801e89
Signed-off-by: Dan Ryan <dan@danryan.co>
28 lines
805 B
Python
28 lines
805 B
Python
import pytest
|
|
|
|
import pipenv.pythonfinder
|
|
|
|
|
|
@pytest.mark.utils
|
|
def test_parse_python_version():
|
|
ver = pipenv.pythonfinder.parse_python_version('Python 3.6.5\n')
|
|
assert ver == {'major': '3', 'minor': '6', 'micro': '5'}
|
|
|
|
|
|
@pytest.mark.utils
|
|
def test_parse_python_version_suffix(self):
|
|
ver = pipenv.pythonfinder.parse_python_version('Python 3.6.5rc1\n')
|
|
assert ver == {'major': '3', 'minor': '6', 'micro': '5'}
|
|
|
|
|
|
@pytest.mark.utils
|
|
def test_parse_python_version_270():
|
|
ver = pipenv.pythonfinder.parse_python_version('Python 2.7\n')
|
|
assert ver == {'major': '2', 'minor': '7', 'micro': '0'}
|
|
|
|
|
|
@pytest.mark.utils
|
|
def test_parse_python_version_270_garbage():
|
|
ver = pipenv.pythonfinder.parse_python_version('Python 2.7+\n')
|
|
assert ver == {'major': '2', 'minor': '7', 'micro': '0'}
|