Revision 67fc3042 test/ganeti.constants_unittest.py
b/test/ganeti.constants_unittest.py | ||
---|---|---|
23 | 23 |
|
24 | 24 |
|
25 | 25 |
import unittest |
26 |
import re |
|
26 | 27 |
|
27 | 28 |
from ganeti import constants |
28 | 29 |
|
... | ... | |
54 | 55 |
constants.CONFIG_REVISION)) |
55 | 56 |
|
56 | 57 |
|
58 |
class TestParameterNames(unittest.TestCase): |
|
59 |
"""HV/BE parameter tests""" |
|
60 |
VALID_NAME = re.compile("^[a-zA-Z_][a-zA-Z0-9_]*$") |
|
61 |
|
|
62 |
def testNoDashes(self): |
|
63 |
for kind, source in [('hypervisor', constants.HVS_PARAMETER_TYPES), |
|
64 |
('backend', constants.BES_PARAMETER_TYPES)]: |
|
65 |
for key in source: |
|
66 |
self.failUnless(self.VALID_NAME.match(key), |
|
67 |
"The %s parameter '%s' contains invalid characters" % |
|
68 |
(kind, key)) |
|
69 |
|
|
57 | 70 |
if __name__ == '__main__': |
58 | 71 |
unittest.main() |
Also available in: Unified diff