`expect_that`

Source
See also: expect, How to develop integration tests for interactive commands with expect

Usage:

expect_that “<juju_command>” “<expect_script_body>” [<timeout>]

Summary:

The expect_that function uses the expect tool to test a Juju interactive command against an expect script.

The function comes with your installation of Juju, though to use it you must also install the expect tool.