48
48
def test_main(self):
49
49
argv = ["an-env", "/bin/juju", "/tmp/logs", "an-env-mod", "--verbose"]
50
51
client = Mock(spec=["is_jes_enabled"])
51
52
with patch("assess_min_version.configure_logging",
52
53
autospec=True) as mock_cl:
53
54
with patch("assess_min_version.BootstrapManager.booted_context",
54
55
autospec=True) as mock_bc:
55
with patch("deploy_stack.client_from_config",
56
return_value=client) as mock_c:
57
with patch("assess_min_version.assess_min_version",
58
autospec=True) as mock_assess:
56
with patch("jujupy.SimpleEnvironment.from_config",
57
return_value=env) as mock_e:
58
with patch("jujupy.EnvJujuClient.by_version",
59
return_value=client) as mock_c:
60
with patch("assess_min_version.assess_min_version",
61
autospec=True) as mock_assess:
60
63
mock_cl.assert_called_once_with(logging.DEBUG)
61
mock_c.assert_called_once_with('an-env', "/bin/juju", debug=False,
64
mock_e.assert_called_once_with("an-env")
65
mock_c.assert_called_once_with(env, "/bin/juju", debug=False)
63
66
self.assertEqual(mock_bc.call_count, 1)
64
67
mock_assess.assert_called_once_with(client)