Example #1
0
 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)
Example #2
0
 def test_assertThat(self):
     code = "assert that x == y"
     expected = "self.assertTrue(x == y)"
     actual = ut(comparisons(code))
     self.assertEquals(expected, actual)
Example #3
0
 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)
Example #4
0
 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)
Example #5
0
 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)
Example #6
0
 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)
Example #7
0
 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)
Example #8
0
 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)
Example #9
0
 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)