Commit 28a34a39 authored by Guido Trotter's avatar Guido Trotter
Browse files

Add unittests for confd constants

Checking that the fourcc code is indeed a fourcc code, and that request
codes and reply statuses are distinct.
Signed-off-by: default avatarGuido Trotter <>
Reviewed-by: default avatarMichael Hanselmann <>
parent 86488201
......@@ -74,5 +74,29 @@ class TestParameterNames(unittest.TestCase):
(kind, key))
class TestConfdConstants(unittest.TestCase):
"""Test the confd constants"""
def testFourCc(self):
self.failUnlessEqual(len(constants.CONFD_MAGIC_FOURCC), 4,
"Invalid fourcc len, should be 4")
def _IsUniqueSequence(self, sequence):
seen = set()
for member in sequence:
if member in seen:
return False
return True
def testReqs(self):
"Duplicated confd request code")
def testReplStatuses(self):
"Duplicated confd reply status code")
if __name__ == '__main__':
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment