File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313from juju import jasyncio
1414from juju .errors import JujuConnectionError
1515
16+ from .. import base
17+
1618
1719def _make_delta (entity , type_ , data = None ):
1820 from juju .client .client import Delta
@@ -297,7 +299,7 @@ async def test_timeout(self):
297299 async def test_wait_for_active_status (self ):
298300 # create a custom apps mock
299301 from types import SimpleNamespace
300- apps = { "dummy_app" : SimpleNamespace (
302+ app = SimpleNamespace (
301303 status = "active" ,
302304 units = [SimpleNamespace (
303305 name = "mockunit/0" ,
@@ -306,7 +308,14 @@ async def test_wait_for_active_status(self):
306308 machine = None ,
307309 agent_status = "idle" ,
308310 )],
309- )}
311+ )
312+ # This is a small hack to act like we're getting 'unknown'
313+ # from the api (the get_status() call), which shouldn't
314+ # change the semantics of this test, as the 'unknown'
315+ # has the lowest severity (so the app's 'active' status
316+ # will overrule it)
317+ app .get_status = base .AsyncMock (return_value = 'unknown' )
318+ apps = {"dummy_app" : app }
310319
311320 with patch .object (Model , 'applications' , new_callable = PropertyMock ) as mock_apps :
312321 mock_apps .return_value = apps
You can’t perform that action at this time.
0 commit comments