def test_assertThatIsBetween(self): code = "assert that x is between 0 and 9" expected = "self.assertTrue(0 <= x <= 9)" actual = ut(comparisons(code)) self.assertEquals(expected, actual)
def test_assertThat(self): code = "assert that x == y" expected = "self.assertTrue(x == y)" actual = ut(comparisons(code)) self.assertEquals(expected, actual)
def test_assertThatIsGreaterThanOrEqualTo(self): code = "assert that x is greater than or equal to y" expected = "self.assertTrue(x >= y)" actual = ut(comparisons(code)) self.assertEquals(expected, actual)
def test_assertThatIsLessThanOrEqualTo(self): code = "assert that x is less than or equal to y" expected = "self.assertTrue(x <= y)" actual = ut(comparisons(code)) self.assertEquals(expected, actual)
def test_assertThatIsNotEqualTo(self): code = "assert that x is not equal to y" expected = "self.assertTrue(x != y)" actual = ut(comparisons(code)) self.assertEquals(expected, actual)
def test_gte(self): code = "if x is greater than or equal to foo() + 4: print foo()" expected = "if x >= foo() + 4: print foo()" actual = comparisons(code) self.assertEqual(expected, actual)
def test_between(self): code = "if x is between 0 and 10: print x" expected = "if 0 <= x <= 10: print x" actual = comparisons(code) self.assertEqual(expected, actual)
def test_ne(self): code = "if x is not equal to foo() + 4: print foo()" expected = "if x != foo() + 4: print foo()" actual = comparisons(code) self.assertEqual(expected, actual)
def test_lte(self): code = "if x is less than or equal to foo() + 4: print foo()" expected = "if x <= foo() + 4: print foo()" actual = comparisons(code) self.assertEqual(expected, actual)