コード例 #1
0
ファイル: TestCarrotland.py プロジェクト: grovesr/foo_bar
 def test_slope_negative(self):
     s1 = IntegerSegment(IntegerPoint(0, 0), IntegerPoint(2, -1))
     self.assertEqual(s1.slope(), -0.5)
コード例 #2
0
ファイル: TestCarrotland.py プロジェクト: grovesr/foo_bar
 def test_slope_zero(self):
     s1 = IntegerSegment(IntegerPoint(0, 0), IntegerPoint(1, 0))
     self.assertEqual(s1.slope(), 0)
コード例 #3
0
ファイル: TestCarrotland.py プロジェクト: grovesr/foo_bar
 def test_slope_positive(self):
     s1 = IntegerSegment(IntegerPoint(0, 0), IntegerPoint(2, 1))
     self.assertEqual(s1.slope(), 0.5)
コード例 #4
0
ファイル: TestCarrotland.py プロジェクト: grovesr/foo_bar
 def test_slope_inf(self):
     s1 = IntegerSegment(IntegerPoint(0, 0), IntegerPoint(0, 1))
     self.assertEqual(s1.slope(), float("inf"))