File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
256270async def test_upgrade_charm_resource (event_loop ):
You can’t perform that action at this time.
0 commit comments