Revision 29a32ce5 test/ganeti.ssconf_unittest.py

b/test/ganeti.ssconf_unittest.py
169 169
                        "cluster.example.com", _cfg_location=self.tmpdir)
170 170

  
171 171

  
172
class TestVerifyKeys(unittest.TestCase):
173
  def testNoKeys(self):
174
    ssconf.VerifyKeys({})
175

  
176
  def testValidKeys(self):
177
    ssconf.VerifyKeys(ssconf._VALID_KEYS)
178

  
179
    for key in ssconf._VALID_KEYS:
180
      ssconf.VerifyKeys([key])
181

  
182
  def testInvalidKeys(self):
183
    for key in ["", ".", " ", "foo", "bar", "HelloWorld"]:
184
      self.assertRaises(errors.GenericError, ssconf.VerifyKeys, [key])
185

  
186

  
172 187
if __name__ == "__main__":
173 188
  testutils.GanetiTestProgram()

Also available in: Unified diff