Skip to content

Commit e747ce5

Browse files
committed
Add integration test for refresh local charm with resources
1 parent 138e53a commit e747ce5

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

tests/integration/test_application.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import logging
55

66
from .. import base
7+
from ..utils import INTEGRATION_TEST_DIR
78
from juju import errors
89
from juju.url import URL, Schema
910

@@ -237,6 +238,28 @@ async def test_upgrade_charm_resource_same_rev_no_update(event_loop):
237238
assert ress['policyd-override'].fingerprint == ress2['policyd-override'].fingerprint
238239

239240

241+
@base.bootstrapped
242+
@pytest.mark.asyncio
243+
async def test_upgrade_local_charm_with_resource(event_loop):
244+
charm_path = INTEGRATION_TEST_DIR / 'file-resource-charm'
245+
async with base.CleanModel() as model:
246+
app = await model.deploy(str(charm_path))
247+
assert 'file-resource-charm' in model.applications
248+
249+
await model.wait_for_idle()
250+
assert app.units[0].agent_status == 'idle'
251+
252+
resources = {"file-res": "test.file"}
253+
await app.refresh(local_charm_path=str(charm_path), resources=resources)
254+
255+
await model.wait_for_idle()
256+
assert app.units[0].agent_status == 'idle'
257+
258+
ress = await app.get_resources()
259+
assert 'file-res' in ress
260+
assert ress['file-res']
261+
262+
240263
@base.bootstrapped
241264
@pytest.mark.asyncio
242265
async def test_trusted(event_loop):

0 commit comments

Comments
 (0)