Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def make_test_model(foo_unit=True, foo_status='idle'):
juju_model = Model()
state = juju_model.state
state.apply_delta(ApplicationDelta(
('application', 'type2', {'name': 'foo'})))
if foo_unit:
state.apply_delta(UnitDelta(('unit', 'type1', {
'name': 'steve',
'application': 'foo',
# Add some status to fake out chaos's "wait 'til the
# cloud is idle" check.
'agent-status': {'current': foo_status}
})))
return juju_model