def test_parse_install_output(self): """Ensure pip output is parsed properly.""" install_output = ( "Collecting requests\n" "Using cached requests-2.13.0-py2.py3-none-any.whl\n" "Successfully downloaded requests-2.13.0\n" "Collecting honcho\n" "Using cached honcho-0.7.1.tar.gz\n" "Successfully downloaded honcho-0.7.1\n" "Collecting foursquare\n" "Downloading foursquare-1%212015.4.7.tar.gz\n" "Saved ./foursquare-1%212015.4.7.tar.gz\n" "Successfully downloaded foursquare\n" "Collecting django-debug-toolbar\n" "Using cached django_debug_toolbar-1.6-py2.py3-none-any.whl\n" "Collecting sqlparse>=0.2.0 (from django-debug-toolbar)\n" "Using cached sqlparse-0.2.2-py2.py3-none-any.whl\n") names_map = dict(parse_install_output(install_output)) # Verify files are added to names map with appropriate project name. assert 'requests-2.13.0-py2.py3-none-any.whl' in names_map assert names_map['requests-2.13.0-py2.py3-none-any.whl'] == 'requests' # Verify percent-encoded characters are unencoded (%21 -> !). assert 'foursquare-1!2015.4.7.tar.gz' in names_map # Verify multiple dashes in name is parsed correctly. assert 'django_debug_toolbar-1.6-py2.py3-none-any.whl' in names_map assert names_map[ 'django_debug_toolbar-1.6-py2.py3-none-any.whl'] == 'django-debug-toolbar'
def test_parse_install_output(self): """Ensure pip output is parsed properly.""" install_output = ("Collecting requests\n" "Using cached requests-2.13.0-py2.py3-none-any.whl\n" "Successfully downloaded requests-2.13.0\n" "Collecting honcho\n" "Using cached honcho-0.7.1.tar.gz\n" "Successfully downloaded honcho-0.7.1\n" "Collecting foursquare\n" "Downloading foursquare-1%212015.4.7.tar.gz\n" "Saved ./foursquare-1%212015.4.7.tar.gz\n" "Successfully downloaded click\n") names_map = dict(parse_install_output(install_output)) # Verify files are added to names map with appropriate project name. assert 'requests-2.13.0-py2.py3-none-any.whl' in names_map assert names_map['requests-2.13.0-py2.py3-none-any.whl'] == 'requests' # Verify percent-encoded characters are unencoded (%21 -> !). assert 'foursquare-1!2015.4.7.tar.gz' in names_map
def test_parse_install_output(self): """Ensure pip output is parsed properly.""" install_output = ("Collecting requests\n" "Using cached requests-2.13.0-py2.py3-none-any.whl\n" "Successfully downloaded requests-2.13.0\n" "Collecting honcho\n" "Using cached honcho-0.7.1.tar.gz\n" "Successfully downloaded honcho-0.7.1\n" "Collecting foursquare\n" "Downloading foursquare-1%212015.4.7.tar.gz\n" "Saved ./foursquare-1%212015.4.7.tar.gz\n" "Successfully downloaded click\n") names_map = dict(parse_install_output(install_output)) # Verify files are added to names map with appropriate project name. assert 'requests-2.13.0-py2.py3-none-any.whl' in names_map assert names_map['requests-2.13.0-py2.py3-none-any.whl'] == 'requests' # Verify percent-encoded characters are unencoded (%21 -> !). assert 'foursquare-1!2015.4.7.tar.gz' in names_map