Commit 7bb6e137 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

Replace custom algorithm in constants unittest

There is no need for the “_IsUniqueSequence” function anymore, it can
easily be replaced by utils.FindDuplicates. Also, pass the message as a
keyword parameter and use the more commonly used assert* functions.
Signed-off-by: default avatarMichael Hanselmann <>
Reviewed-by: default avatarIustin Pop <>
parent 2ff01d78
......@@ -131,25 +131,17 @@ 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
self.assertEqual(len(constants.CONFD_MAGIC_FOURCC), 4,
msg="Invalid fourcc len, should be 4")
def testReqs(self):
"Duplicated confd request code")
msg="Duplicated confd request code")
def testReplStatuses(self):
"Duplicated confd reply status code")
msg="Duplicated confd reply status code")
if __name__ == '__main__':
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