<s> """<STR_LIT>""" <EOL> import pytest <EOL> from os . path import isdir , isfile <EOL> from tests . lib import pyversion , assert_all_changes <EOL> from tests . functional . test_install_user import _patch_dist_in_site_packages <EOL> class Tests_UninstallUserSite : <EOL> @ pytest . mark . network <EOL> def test_uninstall_from_usersite ( self , script , virtualenv ) : <EOL> """<STR_LIT>""" <EOL> virtualenv . system_site_packages = True <EOL> result1 = script . pip ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> result2 = script . pip ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> assert_all_changes ( result1 , result2 , [ script . venv / '<STR_LIT>' , '<STR_LIT>' ] ) <EOL> def test_uninstall_from_usersite_with_dist_in_global_site ( <EOL> self , script , virtualenv ) : <EOL> """<STR_LIT>""" <EOL> virtualenv . system_site_packages = True <EOL> script . environ [ "<STR_LIT>" ] = script . base_path / script . user_site <EOL> _patch_dist_in_site_packages ( script ) <EOL> script . pip_install_local ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> result2 = script . pip_install_local ( <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> result3 = script . pip ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> assert script . user_bin_path in result3 . stdout <EOL> assert script . bin_path not in result3 . stdout <EOL> assert_all_changes ( result2 , result3 , [ script . venv / '<STR_LIT>' , '<STR_LIT>' ] ) <EOL> egg_info_folder = ( <EOL> script . base_path / script . site_packages / <EOL> '<STR_LIT>' % pyversion <EOL> ) <EOL> assert isdir ( egg_info_folder ) <EOL> def test_uninstall_editable_from_usersite ( self , script , virtualenv , data ) : <EOL> """<STR_LIT>""" <EOL> virtualenv . system_site_packages = True <EOL> script . user_site_path . makedirs ( ) <EOL> to_install = data . packages . join ( "<STR_LIT>" ) <EOL> result1 = script . pip ( <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , to_install , expect_error = False , <EOL> ) <EOL> egg_link = script . user_site / '<STR_LIT>' <EOL> assert egg_link in result1 . files_created , str ( result1 . stdout ) <EOL> result2 = script . pip ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> assert not isfile ( script . base_path / egg_link ) <EOL> assert_all_changes ( <EOL> result1 , <EOL> result2 , <EOL> [ <EOL> script . venv / '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> script . user_site / '<STR_LIT>' , <EOL> ] <EOL> ) </s>
