Commit 750022e0 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

Add simple unittest for utils.CommaJoin


Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 91c69b44
......@@ -2314,5 +2314,15 @@ class TestShellWriter(unittest.TestCase):
self.assertEqual(buf.getvalue(), "")
class TestCommaJoin(unittest.TestCase):
def test(self):
self.assertEqual(utils.CommaJoin([]), "")
self.assertEqual(utils.CommaJoin([1, 2, 3]), "1, 2, 3")
self.assertEqual(utils.CommaJoin(["Hello"]), "Hello")
self.assertEqual(utils.CommaJoin(["Hello", "World"]), "Hello, World")
self.assertEqual(utils.CommaJoin(["Hello", "World", 99]),
"Hello, World, 99")
if __name__ == '__main__':
testutils.GanetiTestProgram()
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