4 1. Connects to the current model
5 2. Deploy a charm and waits until it reports itself active
6 3. Destroys the unit and application
10 from juju
.model
import Model
15 print('Connecting to model')
16 await model
.connect_current()
19 print('Deploying ubuntu')
20 application
= await model
.deploy(
22 application_name
='ubuntu',
27 print('Waiting for active')
28 await model
.block_until(
29 lambda: all(unit
.workload_status
== 'active'
30 for unit
in application
.units
))
32 print('Removing ubuntu')
33 await application
.remove()
35 print('Disconnecting from model')
36 await model
.disconnect()
39 if __name__
== '__main__':