[PATCH 3/5] Add test for the have_word_match function
Anne Mulhern
amulhern at redhat.com
Tue Nov 12 14:02:00 UTC 2013
----- Original Message -----
From: "Martin Kolman" <mkolman at redhat.com>
To: anaconda-patches at lists.fedorahosted.org
Sent: Monday, November 11, 2013 12:14:06 PM
Subject: [PATCH 3/5] Add test for the have_word_match function
From: Vratislav Podzimek <vpodzime at redhat.com>
Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
---
tests/pyanaconda_tests/iutil_test.py | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/tests/pyanaconda_tests/iutil_test.py b/tests/pyanaconda_tests/iutil_test.py
index 692671c..985a708 100644
--- a/tests/pyanaconda_tests/iutil_test.py
+++ b/tests/pyanaconda_tests/iutil_test.py
@@ -439,3 +439,15 @@ class RunProgramTests(unittest.TestCase):
_out = "heiz\xc3\xb6lr\xc3\xbccksto\xc3\x9fabd\xc3\xa4mpfung"
self.assertEqual(iutil.lowerASCII("Heizölrückstoßabdämpfung"), _out)
+ def have_word_match_test(self):
+ """Test have_word_match."""
+
+ self.assertTrue(iutil.have_word_match("word1 word2", "word1 word2 word3"))
+ self.assertTrue(iutil.have_word_match("word1 word2", "word2 word1 word3"))
+ self.assertTrue(iutil.have_word_match("word2 word1", "word3 word1 word2"))
+ self.assertTrue(iutil.have_word_match("word1", "word1 word2"))
+ self.assertTrue(iutil.have_word_match("", "word1"))
+
+ self.assertFalse(iutil.have_word_match("word3 word1", "word1"))
+ self.assertFalse(iutil.have_word_match("word1 word3", "word1 word2"))
+ self.assertFalse(iutil.have_word_match("word3 word2", "word1 word2"))
--
Ack.
1.8.4.2
_______________________________________________
anaconda-patches mailing list
anaconda-patches at lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
More information about the anaconda-patches
mailing list