def test_will_remove_archive_packages_that_have_been_removed(self, mock_subprocess, mock_pip_runner):
        self.setup_files(DIFFERENT_SAMPLE_YAML_CONTENT, SAMPLE_CACHE_CONTENT)
        self.create_package('qt')
        self.create_package('json')
        cache = PackageCache('myProject', self._base_path)
        (config, packages) = reader.devenv_from_file(self._yaml_file)

        uninstaller = PackageUninstaller(cache, packages, mock_pip_runner)
        uninstaller.uninstall_changed_packages()

        self.assertFalse(os.path.exists(os.path.join(self._deps, 'json')))
    def test_will_call_pip_for_removed_system_packages(self, mock_subprocess, mock_pip_runner):
        self.setup_files(DIFFERENT_SAMPLE_YAML_CONTENT, SAMPLE_CACHE_CONTENT)
        self.create_package('qt')
        self.create_package('json')
        cache = PackageCache('myProject', self._base_path)
        (config, packages) = reader.devenv_from_file(self._yaml_file)

        uninstaller = PackageUninstaller(cache, packages, mock_pip_runner)
        uninstaller.uninstall_changed_packages()

        mock_pip_runner.remove.assert_called_once_with('git-python', '0.3.10')