Skip to content

Commit 5d55af6

Browse files
committed
Reactivate charmhub test for channel filtering
1 parent d2871a3 commit 5d55af6

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

tests/integration/test_charmhub.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,21 @@ async def test_info(event_loop):
2929

3030
@base.bootstrapped
3131
@pytest.mark.asyncio
32-
@pytest.mark.skip('CharmHub facade no longer exists')
3332
async def test_info_with_channel(event_loop):
3433
async with base.CleanModel() as model:
35-
result = await model.charmhub.info("hello-juju", "latest/stable")
34+
charm_info = await model.charmhub.info("juju-qa-test", "2.0/stable")
35+
assert charm_info['name'] == 'juju-qa-test'
36+
assert '2.0/stable' in charm_info['channel-map']
37+
assert 'latest/stable' not in charm_info['channel-map']
3638

37-
assert result.result.name == "hello-juju"
38-
assert "latest/stable" in result.result.channel_map
39+
try:
40+
await model.charmhub.info("juju-qa-test", "non-existing-channel")
41+
except JujuError as err:
42+
assert err.message == 'Charmhub.info : channel ' \
43+
'non-existing-channel not found for ' \
44+
'juju-qa-test'
45+
else:
46+
assert False, "non-existing-channel didn't raise an error"
3947

4048

4149
@base.bootstrapped

0 commit comments

Comments
 (0)