From f70d4202f33b685aabf797ff59dcbab849e0c62f Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Wed, 12 Dec 2012 13:03:50 +0100 Subject: Add selftests for get_mainmenu_text(). --- testsuite.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'testsuite.py') diff --git a/testsuite.py b/testsuite.py index ceb6123..789fcf9 100644 --- a/testsuite.py +++ b/testsuite.py @@ -527,6 +527,22 @@ def run_selftests(): "get_defconfig_filename() should return the existent file " "Kconfiglib/tests/defconfig_2") + # + # get_mainmenu_text() + # + + print "Testing get_mainmenu_text()..." + + c = kconfiglib.Config("Kconfiglib/tests/Kempty") + verify(c.get_mainmenu_text() is None, + "An empty Kconfig should not have a mainmenu text") + + # Expanded in the mainmenu text + os.environ["FOO"] = "bar baz" + c = kconfiglib.Config("Kconfiglib/tests/Kmainmenu") + verify(c.get_mainmenu_text() == "---bar baz---", + "Wrong mainmenu text") + # # Misc. minor APIs # -- cgit v1.2.3