コード例 #1
0
 def test_series_list(self):
     """Charm has a series key that is a list."""
     linter = Mock()
     charm = {
         'series': ['trusty'],
     }
     validate_series(charm, linter)
     self.assertFalse(linter.err.called)
コード例 #2
0
 def test_series_not_list(self):
     """Charm has a series key, but the value is not a list."""
     linter = Mock()
     charm = {
         'series': 'trusty',
     }
     validate_series(charm, linter)
     linter.err.assert_called_once_with(
             'series: must be a list of series names')
コード例 #3
0
 def test_no_series(self):
     """Charm does not have a series key."""
     linter = Mock()
     charm = {}
     validate_series(charm, linter)
     self.assertTrue(linter.err.called)