def package_list(args: List[str]) -> None: if len(args) > 0: for name in args: show_package_contents(name) else: if logger.isEnabledFor(VERBOSE): table = [] for pacname in packaging.installed_names(): package = read_package_info(pacname) if package is None: table.append( [pacname, "package info is missing or broken", "0"]) else: table.append( [pacname, package["title"], str(package["num_files"])]) tty.print_table(["Name", "Title", "Files"], [tty.bold, "", ""], table) else: for pacname in packaging.installed_names(): sys.stdout.write("%s\n" % pacname)
def test_create(): assert packaging.installed_names() == [] _create_simple_test_package("aaa") assert packaging.installed_names() == ["aaa"]