tests.test_cli_search moduleยถ
- class tests.test_cli_search.TestSearch[source]ยถ
Bases:
CLITableTests- 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 match.', max_width=None, optional=False, sortable=True), SortableField.MANAGER_ID), (ColumnSpec(id='latest_version', label='Latest version', description='Latest version available.', max_width='auto', optional=False, sortable=True), SortableField.VERSION), (ColumnSpec(id='description', label='Description', description='Package description, for managers that provide one. Out of the default selection: select it explicitly or pass --description.', max_width='auto', optional=False, sortable=True), None))ยถ
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.
- test_description_column_selection(invoke, fake_pool)[source]ยถ
The description column hides by default, and shows with
--description.An explicit
--columnsselection is authoritative either way.
- test_unicode_search(invoke, monkeypatch)[source]ยถ
Check
mpmis accepting unicode as search query.masis the only manager we have that is accepting unicode characters for its package names. We perform a search with it so we can provempmis supporting it too:$ mpm --mas search ้ โญโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโฌโโโโโโโโโโโโโโโโโฎ โ Package ID โ Name โ Manager โ Latest version โ โโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโผโโโโโโโโโโโโโโโโโค โ 1435447041 โ ้้ - ่ฎฉ่ฟๆญฅๅ็ โ mas โ 7.6.57 โ โฐโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโดโโโโโโโโโโโโโโโโโฏ
Test originates from #16.
Note
The search answer is canned, so the assertions below run on every macOS host instead of only a lucky one.
mas searchqueriesitunes.apple.comover the network for every call, and an unreachable API returns the same empty table as a query mpm mangled: asserting through the live call reports a unicode bug whenever the host is offline, firewalled or signed out of the App Store, which is why this test used to be skipped on GitHub Actions. Only the search is canned, every other call reaching the real binary, somasstill has to be installed and answer its version probe for the selector to resolve it.