diff --git a/charmtools/charms.py b/charmtools/charms.py index facc2ac7..3a4f3414 100644 --- a/charmtools/charms.py +++ b/charmtools/charms.py @@ -717,6 +717,7 @@ def validate_deployment(charm, linter): deployment = charm['deployment'] if not isinstance(deployment, dict): linter.err('deployment: must be a dict of config') + return known_field_types = { 'type': str, diff --git a/tests/test_charm_proof.py b/tests/test_charm_proof.py index 0a5ee30a..2040b99f 100644 --- a/tests/test_charm_proof.py +++ b/tests/test_charm_proof.py @@ -831,6 +831,18 @@ def test_deployment(self): validate_deployment(charm, linter) self.assertFalse(linter.err.called) + def test_invalid_deployment(self): + """Charm has invalid deployment.""" + linter = Mock() + charm = { + 'deployment': [], + } + validate_deployment(charm, linter) + self.assertEqual(linter.err.call_count, 1) + linter.err.assert_has_calls([ + call('deployment: must be a dict of config'), + ], any_order=True) + def test_deployment_unsupported_field(self): """Charm has the invalid deployment field.""" linter = Mock()