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)
 def test_cmd_exit_zero_true(self):
     self.assertEqual(psc.check_condition(self.cmd_with_exit(0)), True)
 def test_cmd_exit_one_false(self):
     self.assertEqual(psc.check_condition(self.cmd_with_exit(1)), False)
 def test_true_is_true(self):
     self.assertEqual(psc.check_condition(True), True)
 def test_false_is_false(self):
     self.assertEqual(psc.check_condition(False), False)
 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)
 def test_cmd_exit_one_false(self):
     self.assertEqual(psc.check_condition(self.cmd_with_exit(1)), False)
 def test_cmd_exit_zero_true(self):
     self.assertEqual(psc.check_condition(self.cmd_with_exit(0)), True)
 def test_false_is_false(self):
     self.assertEqual(psc.check_condition(False), False)
 def test_true_is_true(self):
     self.assertEqual(psc.check_condition(True), True)