Skip to content

Commit 92562c2

Browse files
committed
Add integration test for unit.destroy()
1 parent d1e7a5c commit 92562c2

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

tests/integration/test_unit.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,3 +280,19 @@ async def test_subordinate_units(event_loop):
280280
assert n_unit.principal_unit == 'ubuntu/0'
281281
assert u_unit.principal_unit == ''
282282
assert [u.name for u in u_unit.get_subordinates()] == [n_unit.name]
283+
284+
285+
@base.bootstrapped
286+
async def test_destroy_unit(event_loop):
287+
async with base.CleanModel() as model:
288+
app = await model.deploy(
289+
'juju-qa-test',
290+
application_name='test',
291+
num_units=3,
292+
)
293+
# wait for the units to come up
294+
await model.block_until(lambda: app.units, timeout=480)
295+
296+
await app.units[0].destroy()
297+
await asyncio.sleep(5)
298+
assert len(app.units) == 2

0 commit comments

Comments
 (0)