File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -235,7 +235,9 @@ async def test_upgrade_charm_switch(event_loop):
235235 await model .block_until (lambda : (len (app .units ) > 0 and
236236 app .units [0 ].machine ))
237237 assert app .data ['charm-url' ] == 'cs:ubuntu-0'
238- await app .upgrade_charm (switch = 'ubuntu-8' )
238+ with pytest .raises (errors .JujuError ):
239+ await app .upgrade_charm (switch = 'ubuntu-8' )
240+ await app .upgrade_charm (switch = 'cs:ubuntu-8' )
239241 assert app .data ['charm-url' ] == 'cs:ubuntu-8'
240242
241243
@@ -253,6 +255,18 @@ async def test_upgrade_local_charm(event_loop):
253255 assert app .data ['charm-url' ] == 'local:focal/ubuntu-0'
254256
255257
258+ @base .bootstrapped
259+ @pytest .mark .asyncio
260+ async def test_upgrade_switch_charmstore_to_charmhub (event_loop ):
261+ async with base .CleanModel () as model :
262+ app = await model .deploy ('cs:ubuntu' , series = 'focal' )
263+ await model .wait_for_idle (status = "active" )
264+ assert app .data ['charm-url' ].startswith ('cs:ubuntu' )
265+ await app .upgrade_charm (channel = 'latest/stable' , switch = 'ch:ubuntu-8' )
266+ await model .wait_for_idle (status = "active" )
267+ assert app .data ['charm-url' ].startswith ('ch:' )
268+
269+
256270@base .bootstrapped
257271@pytest .mark .asyncio
258272async def test_upgrade_charm_resource (event_loop ):
You can’t perform that action at this time.
0 commit comments