Skip to content

Commit fc161ff

Browse files
committed
Add integration test for local refresh with resources
1 parent 3f33aa4 commit fc161ff

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

tests/integration/test_application.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,26 @@ async def test_upgrade_local_charm(event_loop):
264264
assert app.data['charm-url'] == 'local:focal/ubuntu-0'
265265

266266

267+
@base.bootstrapped
268+
@pytest.mark.asyncio
269+
async def test_upgrade_local_charm_resource(event_loop):
270+
async with base.CleanModel() as model:
271+
tests_dir = Path(__file__).absolute().parent
272+
charm_path = tests_dir / 'file-resource-charm'
273+
resources = {"file-res": "test.file"}
274+
275+
app = await model.deploy(str(charm_path), resources=resources)
276+
assert 'file-resource-charm' in model.applications
277+
await model.wait_for_idle()
278+
assert app.units[0].agent_status == 'idle'
279+
280+
await app.upgrade_charm(path=charm_path, resources=resources)
281+
await model.wait_for_idle()
282+
ress = await app.get_resources()
283+
assert 'file-res' in ress
284+
assert ress['file-res']
285+
286+
267287
@base.bootstrapped
268288
@pytest.mark.asyncio
269289
@pytest.mark.skip('Update charm')

0 commit comments

Comments
 (0)