def test_check_true_false_good(self): results = [] results.append(t.check_true_false('if flag is True', 53)) results.append(t.check_true_false('if True', 53)) results.append(t.check_true_false('if flag is not True', 53)) results.append(t.check_true_false('if not True', 53)) results.append(t.check_true_false('if flag is False', 53)) results.append(t.check_true_false('if not False', 53)) results.append(t.check_true_false('if flag is not False', 53)) results.append(t.check_true_false('if False', 53)) for e in results: self.assertEqual(e, None)
def test_check_true_false_false_is_not(self): ex4 = 'line: 52, column: {0} comparison to False should be'\ ' "if cond is not False:" or "if cond:"' result4 = t.check_true_false('flag != False', 52) self.assertEqual(result4, ex4.format(5))
def test_check_true_false_true_is_not(self): ex2 = 'line: 50, column: {0} comparison to True should be'\ ' "if cond is not True:" or "if not cond:"' result2 = t.check_true_false('flag != True', 50) self.assertEqual(result2, ex2.format(5))
def test_check_true_false_false_is(self): ex3 = 'line: 51, column: {0} comparison to False should be'\ ' "if cond is False:" or "if not cond:"' result3 = t.check_true_false('flag == False', 51) self.assertEqual(result3, ex3.format(5))
def test_check_true_false_true_is(self): ex1 = 'line: 49, column: {0} comparison to True should be' \ ' "if cond is True:" or "if cond:"' result1 = t.check_true_false('flag == True', 49) self.assertEqual(result1, ex1.format(5))