def test_invalid(self): """Charm has a invalid extra-bindings metadata.""" linter = Mock() charm = { 'extra-bindings': 'public', } validate_extra_bindings(charm, linter) linter.err.assert_called_once_with( 'extra-bindings: must be a dictionary')
def test_valid(self): """Charm has a valid extra-bindings metadata.""" linter = Mock() charm = { 'extra-bindings': { 'public': None, } } validate_extra_bindings(charm, linter) self.assertFalse(linter.err.called)