コード例 #1
0
def test_x_equal_to_y_returns_0():
    for x in [0, 1, -1, 1.1]:
        assert compare(x, x) == 0
コード例 #2
0
def test_failing():
    assert compare(1, 0) == 0
コード例 #3
0
def test_x_greater_than_y_returns_1():
    for x, y in [(2, 1), (1, 0), (0, -1), (1.1, 1)]:
        assert compare(x, y) == 1
コード例 #4
0
 def test_x_greater_than_y_returns_1(self):
     for x, y in [(2, 1), (1, 0), (0, -1), (1.1, 1)]:
         self.assertEquals(compare(x, y), 1)
コード例 #5
0
def test_x_less_than_y_returns_minus_1():
    for x, y in [(1, 2), (0, 1), (-1, 0), (1, 1.1)]:
        assert compare(x, y) == -1
コード例 #6
0
 def test_x_less_than_y_returns_minus_1(self):
     for x, y in [(1, 2), (0, 1), (-1, 0), (1, 1.1)]:
         self.assertEquals(compare(x, y), -1)
コード例 #7
0
 def test_failing(self):
     self.assertEquals(compare(1, 0), 0)
コード例 #8
0
 def test_x_equal_to_y_returns_0(self):
     for x in [0, 1, -1, 1.1]:
         self.assertEquals(compare(x, x), 0)
コード例 #9
0
 def test_x_greater_than_y_returns_1(self):
     for x, y in [(2, 1), (1, 0), (0, -1), (1.1, 1)]:
         self.assertEquals(compare(x, y), 1)
コード例 #10
0
 def test_failing(self):
     self.assertEquals(compare(1, 0), 0)
コード例 #11
0
 def test_x_less_than_y_returns_minus_1(self):
     for x, y in [(1, 2), (0, 1), (-1, 0), (1, 1.1)]:
         self.assertEquals(compare(x, y), -1)
コード例 #12
0
 def test_x_equal_to_y_returns_0(self):
     for x in [0, 1, -1, 1.1]:
         self.assertEquals(compare(x, x), 0)