def test_true(self): """ Test with a true condition. """ result = condition(condition='true', statement='count', _else='-count') self.assertIs(result, self) self.assertEqual(self.count, 1)
def test_empty_condition(self): """ Test with an empty condition. """ result = condition(statement='count', _else='-count') self.assertIs(result, self) self.assertEqual(self.count, -1)
def test_empty_action(self): """ Test with an empty statement. """ result = condition(condition='true', _else='-count') self.assertIsNone(result) self.assertEqual(self.count, 0)
def test_empty(self): """ Test condition with no params """ result = condition() self.assertIsNone(result) self.assertEqual(self.count, 0)
def test_false(self): """ Test with a false condition. """ result = condition( condition='false', statement='count', _else='-count' ) self.assertIs(result, self) self.assertEqual(self.count, -1)