summaryrefslogtreecommitdiff
path: root/selftest/tests
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2012-03-04 03:24:10 +0100
committerJelmer Vernooij <jelmer@samba.org>2012-03-04 18:02:06 +0100
commit4802561d690e63213cc2274a4b72ed278908bf97 (patch)
tree4d1780c18c579d548f7c7ecaa3c48593f10008e9 /selftest/tests
parent7a614ac7104cc59f6af70de1b0ba3eee472c3c21 (diff)
downloadsamba-4802561d690e63213cc2274a4b72ed278908bf97.tar.gz
samba-4802561d690e63213cc2274a4b72ed278908bf97.tar.bz2
samba-4802561d690e63213cc2274a4b72ed278908bf97.zip
selftest.testlist: Add read_testlist.
Diffstat (limited to 'selftest/tests')
-rw-r--r--selftest/tests/test_testlist.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/selftest/tests/test_testlist.py b/selftest/tests/test_testlist.py
index 5f03887b4e..0e7f68bf8e 100644
--- a/selftest/tests/test_testlist.py
+++ b/selftest/tests/test_testlist.py
@@ -22,6 +22,7 @@
from selftest.testlist import (
find_in_list,
read_test_regexes,
+ read_testlist,
)
from cStringIO import StringIO
@@ -53,3 +54,20 @@ class ReadTestRegexesTests(unittest.TestCase):
f = StringIO(" foo # because\nbar\n")
self.assertEquals([("foo", "because"), ("bar", None)],
list(read_test_regexes(f)))
+
+
+class ReadTestlistTests(unittest.TestCase):
+
+ def test_read_list(self):
+ inf = StringIO("-- TEST --\nfoo\nbar\nbla\n")
+ outf = StringIO()
+ self.assertEquals([('foo', 'bar', 'bla', False, False)],
+ list(read_testlist(inf, outf)))
+ self.assertEquals("", outf.getvalue())
+
+ def test_read_list_passes_through(self):
+ inf = StringIO("MORENOISE\n-- TEST --\nfoo\nbar\nbla\nNOISE\n")
+ outf = StringIO()
+ self.assertEquals([('foo', 'bar', 'bla', False, False)],
+ list(read_testlist(inf, outf)))
+ self.assertEquals("MORENOISE\nNOISE\n", outf.getvalue())