[PATCH 3/5] Add test for the have_word_match function

Martin Kolman mkolman at redhat.com
Mon Nov 11 17:14:06 UTC 2013


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"))
-- 
1.8.4.2



More information about the anaconda-patches mailing list