本文整理匯總了Python中Menu.Menu.checkSystemEnvironment方法的典型用法代碼示例。如果您正苦於以下問題:Python Menu.checkSystemEnvironment方法的具體用法?Python Menu.checkSystemEnvironment怎麽用?Python Menu.checkSystemEnvironment使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Menu.Menu
的用法示例。
在下文中一共展示了Menu.checkSystemEnvironment方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: TestMenu
# 需要導入模塊: from Menu import Menu [as 別名]
# 或者: from Menu.Menu import checkSystemEnvironment [as 別名]
class TestMenu(unittest.TestCase):
def setUp(self):
self.m = Menu()
def testCheckSystemEnvironment(self):
self.m.checkWindowsVersion = lambda: "3.1"
self.assertEquals(self.m.checkSystemEnvironment(), False)
self.m.checkWindowsVersion = lambda: "6.1"
self.m.checkFilePath = lambda x: None
self.assertEquals(self.m.checkSystemEnvironment(), False)
self.m.checkWindowsVersion = lambda: "6.1"
self.m.checkFilePath = lambda x: "taskkill.exe"
self.assertEquals(self.m.checkSystemEnvironment(), True)
def testWriteInfoLine(self):
self.assertRaises(ValueError, self.m.writeInfoLine, "ok2", "")
self.assertEquals(self.m.writeInfoLine("ok", "ok`y info."), None)
self.assertEquals(self.m.writeInfoLine("warning", "warning info."), None)
self.assertEquals(self.m.writeInfoLine("error", "error info."), None)
self.assertEquals(self.m.writeInfoLine("fatal", "fatal error info."), None)
self.assertEquals(self.m.writeInfoLine("info", "only info."), None)
self.assertEquals(self.m.writeInfoLine("warning", "custom info.", u"ОПИСАНИЕ"), None)