Beispiel #1
0
 def test_terms_list(self):
     """Charm has a terms key that is a list."""
     linter = Mock()
     charm = {
         'terms': ['lorem-ipsum'],
     }
     validate_terms(charm, linter)
     self.assertFalse(linter.err.called)
 def test_terms_not_list(self):
     """Charm has a terms key, but the value is not a list."""
     linter = Mock()
     charm = {
         'terms': 'lorem-ipsum',
     }
     validate_terms(charm, linter)
     linter.err.assert_called_once_with('terms: must be a list of term ids')
 def test_terms_not_list(self):
     """Charm has a terms key, but the value is not a list."""
     linter = Mock()
     charm = {
         'terms': 'lorem-ipsum',
     }
     validate_terms(charm, linter)
     linter.err.assert_called_once_with(
             'terms: must be a list of term ids')
Beispiel #4
0
 def test_no_terms(self):
     """Charm does not have a terms key."""
     linter = Mock()
     charm = {}
     validate_terms(charm, linter)
     self.assertFalse(linter.err.called)