tests.test_cli_installed module¶
- class tests.test_cli_installed.TestInstalled[source]¶
Bases:
CLITableTests,CLIQueryTests- columns_registry: tuple = ((ColumnSpec(id='package_id', label='Package ID', description="Package's identifier.", max_width=None, optional=False, sortable=True), SortableField.PACKAGE_ID), (ColumnSpec(id='package_name', label='Name', description="Package's common name.", max_width='auto', optional=False, sortable=True), SortableField.PACKAGE_NAME), (ColumnSpec(id='manager_id', label='Manager', description='Manager reporting the package.', max_width=None, optional=False, sortable=True), SortableField.MANAGER_ID), (ColumnSpec(id='installed_version', label='Installed version', description='Version currently installed.', max_width='auto', optional=False, sortable=True), SortableField.VERSION))¶
The subcommand’s column registry (a
tables.py*_COLUMNSconstant).Set by each subclass so the generic
--columnstests below resolve column IDs to their header labels from the same source of truth the CLI uses.
- class tests.test_cli_installed.OverlappingFakeManager[source]¶
Bases:
FakeManagerA second fake, sharing one of its two packages with the first.
The first is
FakeManager.Initialize
cli_errorslist.- property installed¶
List packages currently installed on the system.
Optional. Will be simply skipped by mpm if not implemented.
- cli_names: tuple[str, ...] = ('overlappingfakemanager',)¶
List of CLI names the package manager is known as.
This list of recognized CLI names is ordered by priority. That way we can influence the search of the right binary.
- ..hint::
This was helpful in the case of the Python transition from 2.x to 3.x, where multiple versions of the same executable were named
pythonorpython3.
By default, this property’s value is derived from the manager’s ID (see the
MetaPackageManager.__init__method above).
- documentation_url: str | None = None¶
Entry point of the project’s own documentation, or
Nonewhen it has none.The manual, the documentation site, or the man page of the CLI
mpmdrives: whichever page a user reads to learn the commands this manager wraps. Listed betweenhomepage_urlandrepository_urlin the links of the manager’s page, so a reader reaching for the tool’s reference finds it in the box of facts rather than in the prose below it.Left unset where a link would state a fact twice or invent one: a tool documenting itself in its repository alone, whose README
repository_urlalready reaches. A page about the ecosystem rather than the tool does not qualify either.Where a project’s only site is its manual, that address belongs here and
homepage_urlstays unset: the slot names what the page is, and a reader reaching for the reference looks under the documentation link.Never inherited, like every other link: the AUR helpers extending
pacmaneach document themselves.
- homepage_url: str | None = None¶
Home page of the project, only used in documentation for reference.
Left unset when the home page is the project’s repository, which
repository_urlnames on its own, and when it is the project’s manual, whichdocumentation_urlnames. Never inherited, like the other links.
- id: str = 'overlappingfakemanager'¶
Package manager’s ID.
Derived by defaults from the lower-cased class name in which underscores
_are replaced by dashes-.This ID must be unique among all package manager definitions and lower-case, as they’re used as feature flags for the mpm CLI.
- name: str = 'OverlappingFakeManager'¶
Return package manager’s common name.
Default value is based on class name.
- repository_url: str | None = None¶
Repository holding the project’s code, or
Nonewhen it has no public one.Linked from the manager’s documentation page. Also what the weekly metrics sample reads:
docs/docs_update.pywrites it into the[tool.repomatic.metrics] subjectsofpyproject.tomlwhen its forge answers the sampler, through a mirror for a forge that does not.Never inherited, for the same reason as
wikipedia_url: the AUR helpers extendingpacmaneach live in a repository of their own.
- virtual: bool = False¶
Should we expose the package manager to the user?
Virtual package manager are just skeleton classes used to factorize code among managers of the same family.
- wikipedia_url: str | None = None¶
English Wikipedia article about the project, or
Nonewhen it has none.Listed last in the links of the manager’s documentation page. The article covers the project that home page names, or is a redirect Wikipedia keeps under the project’s name, landing on the part of a broader article that describes it:
Cargo_(software)opens the Cargo section of the Rust article. An article that merely mentions the project does not count, nor does one about a related subject:lazyis a Neovim plugin manager, and the Neovim article is not about it.Never inherited: the metaclass resets it to
Noneon any class not declaring its own. A subclass often wraps a distinct project, like the six AUR helpers extendingpacman, and would otherwise present pacman’s article as its own. Documentation-only, likehomepage_url.
- tests.test_cli_installed.overlapping_pool(patch_pool_with)[source]¶
Select two fakes that both list
fake-pkg-alpha.
--duplicateskeeps the packages that more than one manager lists.