projects
/
ganeti-local
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ecabe27
)
Add UnescapeAndSplit unittest for multi-escapes
author
Iustin Pop
<iustin@google.com>
Wed, 30 Nov 2011 09:33:52 +0000
(10:33 +0100)
committer
Michael Hanselmann
<hansmi@google.com>
Thu, 19 Jan 2012 12:42:19 +0000
(13:42 +0100)
This would have caught the bug in the first place. Argh,
hand-generated test cases!
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
test/ganeti.utils.text_unittest.py
patch
|
blob
|
history
diff --git
a/test/ganeti.utils.text_unittest.py
b/test/ganeti.utils.text_unittest.py
index
91039e1
..
03c8d64
100755
(executable)
--- a/
test/ganeti.utils.text_unittest.py
+++ b/
test/ganeti.utils.text_unittest.py
@@
-387,6
+387,12
@@
class TestUnescapeAndSplit(unittest.TestCase):
b = [sep, sep, "c", "d.moo\\"]
self.assertEqual(utils.UnescapeAndSplit("%s\\" % sep.join(a), sep=sep), b)
+ def testMultipleEscapes(self):
+ for sep in self._seps:
+ a = ["a", "b\\" + sep + "c", "d\\" + sep + "e\\" + sep + "f", "g"]
+ b = ["a", "b" + sep + "c", "d" + sep + "e" + sep + "f", "g"]
+ self.failUnlessEqual(utils.UnescapeAndSplit(sep.join(a), sep=sep), b)
+
class TestCommaJoin(unittest.TestCase):
def test(self):