Exemple #1
0
 def test_delta_val(self):
     """Delta class value, same percentage equality.
     """
     d = Delta("+-25=%")
     self.assertEquals(d.cmp(0, 1), False)
     self.assertEquals(d.cmp(8, 4), True)
     self.assertEquals(d.cmp(8, 6), True)
Exemple #2
0
 def test_delta_val(self):
     """Delta class value, different absolute.
     """
     d = Delta("+2.5-1.5")
     self.assertEquals(d.cmp(0, 1), False)
     self.assertEquals(d.cmp(1, 3), False)
     self.assertEquals(d.cmp(3, 1), True)
Exemple #3
0
 def test_delta_val(self):
     """Delta class value, same absolute equality.
     """
     d = Delta("+-3.0=")
     self.assertEquals(d.cmp(0, 1), False)
     self.assertEquals(d.cmp(1, 4), True)
     self.assertEquals(d.cmp(4, 1), True)
Exemple #4
0
 def test_delta_val(self):
     """Delta class value, same percentage equality.
     """
     d = Delta("+-25=%")
     self.assertEquals(d.cmp(0, 1), False)
     self.assertEquals(d.cmp(8, 4), True)
     self.assertEquals(d.cmp(8, 6), True)
Exemple #5
0
 def test_delta_sign(self):
     """Delta class sign.
     """
     d = Delta("+-")
     self.assertEquals(d.cmp(0, 1), False)
     self.assertEquals(d.cmp(-1, 0), False)
     self.assertEquals(d.cmp(-1, 1), True)
Exemple #6
0
 def test_delta_val(self):
     """Delta class value, same absolute equality.
     """
     d = Delta("+-3.0=")
     self.assertEquals(d.cmp(0, 1), False)
     self.assertEquals(d.cmp(1, 4), True)
     self.assertEquals(d.cmp(4, 1), True)
Exemple #7
0
 def test_delta_val(self):
     """Delta class value, different absolute.
     """
     d = Delta("+2.5-1.5")
     self.assertEquals(d.cmp(0, 1), False)
     self.assertEquals(d.cmp(1, 3), False)
     self.assertEquals(d.cmp(3, 1), True)
Exemple #8
0
 def test_delta_sign(self):
     """Delta class sign.
     """
     d = Delta("+-")
     self.assertEquals(d.cmp(0, 1), False)
     self.assertEquals(d.cmp(-1, 0), False)
     self.assertEquals(d.cmp(-1, 1), True)
Exemple #9
0
 def test_delta_val(self):
     """Delta class value, same absolute.
     """
     d = Delta("+-3")
     self.assertEqual(d.cmp(0, 1), False)
     self.assertEqual(d.cmp(1, 4), False)
     self.assertEqual(d.cmp(1, 5), True)
Exemple #10
0
 def test_delta_val(self):
     """Delta class value, different percentage equality.
     """
     d = Delta("+50-25=%")
     self.assertEquals(d.cmp(0, 1), False)
     self.assertEquals(d.cmp(8, 4), True)
     self.assertEquals(d.cmp(8, 6), True)
     self.assertEquals(d.cmp(6, 8), False)
     self.assertEquals(d.cmp(6, 9), True)
Exemple #11
0
 def test_delta_val(self):
     """Delta class value, different percentage equality.
     """
     d = Delta("+50-25=%")
     self.assertEquals(d.cmp(0, 1), False)
     self.assertEquals(d.cmp(8, 4), True)
     self.assertEquals(d.cmp(8, 6), True)
     self.assertEquals(d.cmp(6, 8), False)
     self.assertEquals(d.cmp(6, 9), True)
Exemple #12
0
 def test_delta_minus(self):
     """Delta class value 'minus only'.
     """
     d = Delta("-50")
     self.assertEquals(d.cmp(0, 50), False)
     self.assertEquals(d.cmp(51, 0), True)
     self.assertEquals(d.cmp(5, 10), False)
     d = Delta("-50=")
     self.assertEquals(d.cmp(50, 0), True)
     d = Delta("-50%")
     self.assertEquals(d.cmp(25, 10), True)
     self.assertEquals(d.cmp(10, 25), False)
Exemple #13
0
 def test_delta_plus(self):
     """Delta class value 'plus only'.
     """
     d = Delta("+50")
     self.assertEquals(d.cmp(0, 50), False)
     self.assertEquals(d.cmp(0, 51), True)
     self.assertEquals(d.cmp(10, 5), False)
     d = Delta("+50=")
     self.assertEquals(d.cmp(0, 50), True)
     d = Delta("+50%")
     self.assertEquals(d.cmp(10, 25), True)
     self.assertEquals(d.cmp(25, 10), False)
Exemple #14
0
 def test_delta_minus(self):
     """Delta class value 'minus only'.
     """
     d = Delta("-50")
     self.assertEquals(d.cmp(0, 50), False)
     self.assertEquals(d.cmp(51, 0), True)
     self.assertEquals(d.cmp(5, 10), False)
     d = Delta("-50=")
     self.assertEquals(d.cmp(50, 0), True)
     d = Delta("-50%")
     self.assertEquals(d.cmp(25, 10), True)
     self.assertEquals(d.cmp(10, 25), False)
Exemple #15
0
 def test_delta_plus(self):
     """Delta class value 'plus only'.
     """
     d = Delta("+50")
     self.assertEquals(d.cmp(0, 50), False)
     self.assertEquals(d.cmp(0, 51), True)
     self.assertEquals(d.cmp(10, 5), False)
     d = Delta("+50=")
     self.assertEquals(d.cmp(0, 50), True)
     d = Delta("+50%")
     self.assertEquals(d.cmp(10, 25), True)
     self.assertEquals(d.cmp(25, 10), False)