Skip to content

Commit 4e4d4fc

Browse files
committed
Pass channel to entityId, and fix unit test
1 parent d8ae94b commit 4e4d4fc

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

juju/bundle.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ async def run(self, context):
434434
if self.charm.startswith('local:'):
435435
return self.charm
436436

437-
entity_id = await context.charmstore.entityId(self.charm)
437+
entity_id = await context.charmstore.entityId(self.charm, channel=self.channel)
438438
log.debug('Adding %s', entity_id)
439439
await context.client_facade.AddCharm(channel=self.channel, url=entity_id, force=False)
440440
return entity_id

tests/unit/test_bundle.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,10 +303,10 @@ async def test_run(self, event_loop):
303303
assert result == "entity_id"
304304

305305
charmstore.entityId.assert_called_once()
306-
charmstore.entityId.assert_called_with("charm")
306+
charmstore.entityId.assert_called_with("charm", channel="channel")
307307

308308
client_facade.AddCharm.assert_called_once()
309-
client_facade.AddCharm.assert_called_with(channel=None,
309+
client_facade.AddCharm.assert_called_with(channel="channel",
310310
url="entity_id",
311311
force=False)
312312

0 commit comments

Comments
 (0)