コード例 #1
0
 def test_command_format(self):
     self.assertEqual(ex.command_format("StAtuS"), "status",
                      "'status' should be all lower case")
     self.assertEqual(ex.command_format("status"), "status",
                      "'status' should be all lower case")
     self.assertEqual(ex.command_format("RuN"), "run",
                      "'run' should be all lower case")
     self.assertEqual(ex.command_format("run"), "run",
                      "'run' should be all lower case")
     self.assertEqual(ex.command_format("PaUsE"), "pause",
                      "'pause' should be all lower case")
     self.assertEqual(ex.command_format("pause"), "pause",
                      "'pause' should be all lower case")
     self.assertEqual(ex.command_format("StOp"), "stop",
                      "'stop' should be all lower case")
     self.assertEqual(ex.command_format("stop"), "stop",
                      "'stop' should be all lower case")
     self.assertEqual(ex.explorer_format("asdas"), None,
                      "other than 'status','run','pause','stop' "
                      + "should return none")
     self.assertEqual(ex.explorer_format("StoPs"), None,
                      "other than 'status','run','pause','stop' "
                      + "should return none")
     self.tearDown()
コード例 #2
0
 def test_explorer_format(self):
     self.assertEqual(ex.explorer_format("ArTiClE"), "article",
                      "'article' should be all lower case")
     self.assertEqual(ex.explorer_format("article"), "article",
                      "'article' should be all lower case")
     self.assertEqual(ex.explorer_format("TwItTeR"), "twitter",
                      "'twitter' should be all lower case")
     self.assertEqual(ex.explorer_format("twitter"), "twitter",
                      "'twitter' should be all lower case")
     self.assertEqual(ex.explorer_format("asdas"), None,
                      "other than 'article' and 'twitter' should return "
                      + "none")
     self.assertEqual(ex.explorer_format("articles"), None,
                      "other than 'article' and 'twitter' should return "
                      + "none")
     self.assertEqual(ex.explorer_format("twitters"), None,
                      "other than 'article' and 'twitter' should return "
                      + "none")
     self.tearDown()