예제 #1
0
 def test_previous_returns_last_area_if_first_is_given(self) -> None:
     first_area = AreaFactory.create()
     last_area = AreaFactory.create()
     circle = Circle(
         first_area,
         last_area,
     )
     self.assertEqual(circle.previous(first_area.id), last_area)
예제 #2
0
 def test_previous_raises_unknown_area_error_if_area_not_within_cicle(
         self) -> None:
     circle = Circle(AreaFactory.create(), )
     with self.assertRaises(UnknownArea):
         circle.previous(AreaIdFactory.create())
예제 #3
0
 def test_previous_returns_area_previous_to_the_given(self) -> None:
     first_area = AreaFactory.create()
     last_area = AreaFactory.create()
     circle = Circle(first_area, last_area)
     self.assertEqual(circle.previous(last_area.id), first_area)