+ wordpress = model.applications.get('wordpress')
+ mysql = model.applications.get('mysql')
+ assert wordpress and mysql
+ await block_until(lambda: (len(wordpress.units) == 1 and
+ len(mysql.units) == 1),
+ timeout=60 * 4)
+
+
+@base.bootstrapped
+@pytest.mark.asyncio
+async def test_deploy_local_bundle_file(event_loop):
+ tests_dir = Path(__file__).absolute().parent.parent
+ bundle_path = tests_dir / 'bundle'
+ mini_bundle_file_path = bundle_path / 'mini-bundle.yaml'
+
+ async with base.CleanModel() as model:
+ await model.deploy(str(mini_bundle_file_path))
+
+ dummy_sink = model.applications.get('dummy-sink')
+ dummy_subordinate = model.applications.get('dummy-subordinate')
+ assert dummy_sink and dummy_subordinate
+ await block_until(lambda: (len(dummy_sink.units) == 1 and
+ len(dummy_subordinate.units) == 1),
+ timeout=60 * 4)
+
+
+@base.bootstrapped
+@pytest.mark.asyncio
+async def test_deploy_invalid_bundle(event_loop):
+ tests_dir = Path(__file__).absolute().parent.parent
+ bundle_path = tests_dir / 'bundle' / 'invalid.yaml'
+ async with base.CleanModel() as model:
+ with pytest.raises(JujuError):
+ await model.deploy(str(bundle_path))
+
+
+@base.bootstrapped
+@pytest.mark.asyncio
+async def test_deploy_local_charm(event_loop):
+ from pathlib import Path
+ tests_dir = Path(__file__).absolute().parent.parent
+ charm_path = tests_dir / 'charm'
+
+ async with base.CleanModel() as model:
+ await model.deploy(str(charm_path))
+ assert 'charm' in model.applications