Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix cli list packages #1852

Merged
merged 4 commits into from
Oct 13, 2020
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/python/quilt3/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def cmd_disable_telemetry():


def cmd_list_packages(registry):
for package_name in get_package_registry(registry).list_packages:
for package_name in get_package_registry(registry).list_packages():
print(package_name)


Expand Down
15 changes: 15 additions & 0 deletions api/python/tests/test_cli.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import tempfile
from pathlib import Path
from unittest import mock
from unittest.mock import patch

import pytest

Expand Down Expand Up @@ -89,3 +90,17 @@ def test_push_with_meta_data(
# check for expected stderr exception message
captured = capsys.readouterr()
assert expected_stderr in captured.err


def test_list_packages(capsys):
registry = 's3://my_test_bucket/'
pkg_names = ('foo/bar', 'foo/bar1', 'foo1/bar')
with patch('quilt3.backends.s3.S3PackageRegistryV1.list_packages') as list_packages_mock:
list_packages_mock.return_value = pkg_names
main.main(('list-packages', registry))

list_packages_mock.assert_called_once()
sir-sigurd marked this conversation as resolved.
Show resolved Hide resolved
captured = capsys.readouterr()
assert 'foo/bar' in captured.out
assert 'foo/bar1' in captured.out
assert 'foo1/bar' in captured.out
sir-sigurd marked this conversation as resolved.
Show resolved Hide resolved
1 change: 1 addition & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
## CLI
* [Added] Add `meta` argument to the push command
([#1793](https://github.com/quiltdata/quilt/issues/1793))
* Fixed issue with `list-packages` command
sir-sigurd marked this conversation as resolved.
Show resolved Hide resolved

## Catalog

Expand Down