Skip to content

Commit d3f72a8

Browse files
committed
Add some unit tests for arg check for wait_for_idle
1 parent 02628a1 commit d3f72a8

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

tests/unit/test_model.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from juju.model import Model
1212
from juju.application import Application
1313
from juju import jasyncio
14-
from juju.errors import JujuConnectionError
14+
from juju.errors import JujuConnectionError, JujuError
1515

1616

1717
def _make_delta(entity, type_, data=None):
@@ -289,6 +289,21 @@ async def test_no_args(self):
289289
# no apps so should return right away
290290
await m.wait_for_idle(wait_for_active=True)
291291

292+
@pytest.mark.asyncio
293+
async def test_apps_no_lst(self):
294+
m = Model()
295+
with self.assertRaises(JujuError):
296+
# apps arg has to be a List[str]
297+
await m.wait_for_idle(apps="should-be-list")
298+
299+
with self.assertRaises(JujuError):
300+
# apps arg has to be a List[str]
301+
await m.wait_for_idle(apps=3)
302+
303+
with self.assertRaises(JujuError):
304+
# apps arg has to be a List[str]
305+
await m.wait_for_idle(apps=[3])
306+
292307
@pytest.mark.asyncio
293308
async def test_timeout(self):
294309
m = Model()

0 commit comments

Comments
 (0)