コード例 #1
0
 def test_cmd_exit_nonzero_warns(self):
     mocklog = mock.Mock()
     self.assertEqual(psc.check_condition(self.cmd_with_exit(2), mocklog),
                      False)
     self.assertEqual(mocklog.warn.call_count, 1)
コード例 #2
0
 def test_cmd_exit_zero_true(self):
     self.assertEqual(psc.check_condition(self.cmd_with_exit(0)), True)
コード例 #3
0
 def test_cmd_exit_one_false(self):
     self.assertEqual(psc.check_condition(self.cmd_with_exit(1)), False)
コード例 #4
0
 def test_true_is_true(self):
     self.assertEqual(psc.check_condition(True), True)
コード例 #5
0
 def test_false_is_false(self):
     self.assertEqual(psc.check_condition(False), False)
コード例 #6
0
 def test_cmd_exit_nonzero_warns(self):
     mocklog = mock.Mock()
     self.assertEqual(
         psc.check_condition(self.cmd_with_exit(2), mocklog), False)
     self.assertEqual(mocklog.warn.call_count, 1)
コード例 #7
0
 def test_cmd_exit_one_false(self):
     self.assertEqual(psc.check_condition(self.cmd_with_exit(1)), False)
コード例 #8
0
 def test_cmd_exit_zero_true(self):
     self.assertEqual(psc.check_condition(self.cmd_with_exit(0)), True)
コード例 #9
0
 def test_false_is_false(self):
     self.assertEqual(psc.check_condition(False), False)
コード例 #10
0
 def test_true_is_true(self):
     self.assertEqual(psc.check_condition(True), True)