Commit 41b10cf6 authored by Guido Trotter's avatar Guido Trotter
Browse files

uidpool: test the separator= argument



Also, fix the string quoting style.
Signed-off-by: default avatarGuido Trotter <ultrotter@google.com>
Reviewed-by: default avatarBalazs Lecz <leczb@google.com>
parent 2f16ea8f
......@@ -46,8 +46,14 @@ class TestUidPool(testutils.GanetiTestCase):
def testParseUidPool(self):
self.assertEqualValues(
uidpool.ParseUidPool('1-100,200,'),
uidpool.ParseUidPool("1-100,200,"),
[(1, 100), (200, 200)])
self.assertEqualValues(
uidpool.ParseUidPool("1000:2000-2500", separator=":"),
[(1000, 1000), (2000, 2500)])
self.assertEqualValues(
uidpool.ParseUidPool("1000\n2000-2500", separator="\n"),
[(1000, 1000), (2000, 2500)])
def testCheckUidPool(self):
# UID < UIDPOOL_UID_MIN
......@@ -66,7 +72,13 @@ class TestUidPool(testutils.GanetiTestCase):
def testFormatUidPool(self):
self.assertEqualValues(
uidpool.FormatUidPool([(1, 100), (200, 200)]),
'1-100, 200'),
"1-100, 200")
self.assertEqualValues(
uidpool.FormatUidPool([(1, 100), (200, 200)], separator=":"),
"1-100:200")
self.assertEqualValues(
uidpool.FormatUidPool([(1, 100), (200, 200)], separator="\n"),
"1-100\n200")
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