Commit 2de58ebe by Arun Babu Neelicattu

commands/show: fix rendering of single package

parent 129ed0e1
...@@ -124,7 +124,7 @@ lists all packages available.""" ...@@ -124,7 +124,7 @@ lists all packages available."""
] ]
table.add_rows(rows) table.add_rows(rows)
table.render(self.io) table.render()
if pkg.requires: if pkg.requires:
self.line("") self.line("")
......
...@@ -84,6 +84,46 @@ pytest 3.7.3 Pytest package ...@@ -84,6 +84,46 @@ pytest 3.7.3 Pytest package
assert expected == tester.io.fetch_output() assert expected == tester.io.fetch_output()
def test_show_basic_with_installed_packages_single(tester, poetry, installed):
poetry.package.add_dependency(Factory.create_dependency("cachy", "^0.1.0"))
cachy_010 = get_package("cachy", "0.1.0")
cachy_010.description = "Cachy package"
installed.add_package(cachy_010)
poetry.locker.mock_lock_data(
{
"package": [
{
"name": "cachy",
"version": "0.1.0",
"description": "Cachy package",
"category": "main",
"optional": False,
"platform": "*",
"python-versions": "*",
"checksum": [],
},
],
"metadata": {
"python-versions": "*",
"platform": "*",
"content-hash": "123456789",
"hashes": {"cachy": []},
},
}
)
tester.execute("cachy")
assert [
"name : cachy",
"version : 0.1.0",
"description : Cachy package",
] == [line.strip() for line in tester.io.fetch_output().splitlines()]
def test_show_basic_with_not_installed_packages_non_decorated( def test_show_basic_with_not_installed_packages_non_decorated(
tester, poetry, installed tester, poetry, installed
): ):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment