

def assert_installed(self, pkg_name, editable=True, with_files=[], without_files=[], without_egg_link=False, use_user_site=False, sub_dir=False):
    e = self.test_env
    if editable:
        pkg_dir = ((e.venv / 'src') / pkg_name.lower())
        if sub_dir:
            pkg_dir = (pkg_dir / sub_dir)
    else:
        without_egg_link = True
        pkg_dir = (e.site_packages / pkg_name)
    if use_user_site:
        egg_link_path = ((e.user_site / pkg_name) + '.egg-link')
    else:
        egg_link_path = ((e.site_packages / pkg_name) + '.egg-link')
    if without_egg_link:
        if (egg_link_path in self.files_created):
            raise TestFailure(('unexpected egg link file created: %r\n%s' % (egg_link_path, self)))
    else:
        if (egg_link_path not in self.files_created):
            raise TestFailure(('expected egg link file missing: %r\n%s' % (egg_link_path, self)))
        egg_link_file = self.files_created[egg_link_path]
        if (not (egg_link_file.bytes.endswith('\n.') and egg_link_file.bytes[:(- 2)].endswith(pkg_dir))):
            raise TestFailure(textwrap.dedent(u(('                    Incorrect egg_link file %r\n                    Expected ending: %r\n                    ------- Actual contents -------\n                    %s\n                    -------------------------------' % (egg_link_file, (pkg_dir + '\n.'), repr(egg_link_file.bytes))))))
    if use_user_site:
        pth_file = (e.user_site / 'easy-install.pth')
    else:
        pth_file = (e.site_packages / 'easy-install.pth')
    if ((pth_file in self.files_updated) == without_egg_link):
        raise TestFailure(('%r unexpectedly %supdated by install' % (pth_file, (((not without_egg_link) and 'not ') or ''))))
    if ((pkg_dir in self.files_created) == (curdir in without_files)):
        raise TestFailure((textwrap.dedent('            expected package directory %r %sto be created\n            actually created:\n            %s\n            ') % (pkg_dir, (((curdir in without_egg_link) and 'not ') or ''), sorted(self.files_created.keys()))))
    for f in with_files:
        if (not ((pkg_dir / f).normpath in self.files_created)):
            raise TestFailure(('Package directory %r missing expected content %r' % (pkg_dir, f)))
    for f in without_files:
        if ((pkg_dir / f).normpath in self.files_created):
            raise TestFailure(('Package directory %r has unexpected content %f' % (pkg_dir, f)))

dataset/ETHPy150Open pypa/pip/tests/lib/__init__.py TestPipResult.assert_installed/VarMisuse@390/715 `without_files`->`without_egg_link`