Skip to content

Commit d04ed93

Browse files
committed
Add app.refresh test switch from CS to CH
1 parent b06b7ea commit d04ed93

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

tests/integration/test_application.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,9 @@ async def test_upgrade_charm_switch(event_loop):
233233
await model.block_until(lambda: (len(app.units) > 0 and
234234
app.units[0].machine))
235235
assert app.data['charm-url'] == 'cs:ubuntu-0'
236-
await app.upgrade_charm(switch='ubuntu-8')
236+
with pytest.raises(errors.JujuError):
237+
await app.upgrade_charm(switch='ubuntu-8')
238+
await app.upgrade_charm(switch='cs:ubuntu-8')
237239
assert app.data['charm-url'] == 'cs:ubuntu-8'
238240

239241

@@ -251,6 +253,18 @@ async def test_upgrade_local_charm(event_loop):
251253
assert app.data['charm-url'] == 'local:focal/ubuntu-0'
252254

253255

256+
@base.bootstrapped
257+
@pytest.mark.asyncio
258+
async def test_upgrade_switch_charmstore_to_charmhub(event_loop):
259+
async with base.CleanModel() as model:
260+
app = await model.deploy('cs:ubuntu', series='focal')
261+
await model.wait_for_idle(status="active")
262+
assert app.data['charm-url'].startswith('cs:ubuntu')
263+
await app.upgrade_charm(channel='latest/stable', switch='ch:ubuntu-8')
264+
await model.wait_for_idle(status="active")
265+
assert app.data['charm-url'].startswith('ch:')
266+
267+
254268
@base.bootstrapped
255269
@pytest.mark.asyncio
256270
async def test_upgrade_charm_resource(event_loop):

0 commit comments

Comments
 (0)