Skip to content

Commit cb9b4a9

Browse files
committed
Add integration test for destroy_units
1 parent 67772d8 commit cb9b4a9

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

tests/integration/test_model.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -882,6 +882,23 @@ async def test_wait_for_idle_with_exact_units_scale_down_zero(event_loop):
882882
assert (end_time - start_time) > 0.001
883883

884884

885+
@base.bootstrapped
886+
@pytest.mark.asyncio
887+
async def test_destroy_units(event_loop):
888+
async with base.CleanModel() as model:
889+
app = await model.deploy(
890+
'ubuntu',
891+
application_name='ubuntu',
892+
series='jammy',
893+
channel='stable',
894+
num_units=3,
895+
)
896+
await model.wait_for_idle(status='active')
897+
await model.destroy_units(*[u.name for u in app.units])
898+
await model.wait_for_idle(timeout=5 * 60, wait_for_exact_units=0)
899+
assert app.units == []
900+
901+
885902
@base.bootstrapped
886903
@pytest.mark.asyncio
887904
async def test_watcher_reconnect(event_loop):

0 commit comments

Comments
 (0)