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 all 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
13 changes: 13 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,15 @@ 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_with()
captured = capsys.readouterr()
assert captured.out.split() == pkg_names
2 changes: 2 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
## CLI
* [Added] Add `meta` argument to the push command
([#1793](https://github.com/quiltdata/quilt/issues/1793))
* [Fixed] Fix a crash of `list-packages` command
([#1852](https://github.com/quiltdata/quilt/issues/1852))

## Catalog

Expand Down