示例#1
0
 def test_zoom_with_enclosure(self):
     """Zoom test with off center circle and difference enclosure"""
     input_ = circ._Circle(1.0, 0.0, 1.0)
     enclosure = circ._Circle(0.0, 0.0, 2.0)
     target = circ._Circle(0.0, 0.0, 1.0)
     actual = circ.scale(input_, target, enclosure)
     expected = circ._Circle(0.5, 0.0, 0.5)
     self.assertEqual(expected, actual)
示例#2
0
 def test_zoom_with_enclosure(self):
     """Zoom test with off center circle and difference enclosure"""
     input = Circle(1.0, 0.0, 1.0)
     enclosure = Circle(0.0, 0.0, 2.0)
     target = Circle(0.0, 0.0, 1.0)
     actual = scale([input], enclosure, target)
     expected = Circle(0.5, 0.0, 0.5)
     self.assertEqual([expected], actual)
示例#3
0
 def test_simple_zoom_and_translation(self):
     """Pan and zoom test with off center circle equal to enclosure."""
     input_ = circ._Circle(0.5, 0.5, 0.5)
     target = circ._Circle(-0.5, 0, 1.0)
     actual = circ.scale(input_, target, input_)
     self.assertEqual(target, actual)
示例#4
0
 def test_simple_zoom_off_center(self):
     """Zoom test with off center circle equal to enclosure."""
     input_ = circ._Circle(0.5, 0.5, 0.5)
     target = circ._Circle(0.5, 0.5, 1.0)
     actual = circ.scale(input_, target, input_)
     self.assertEqual(target, actual)
示例#5
0
 def test_simple_zoom(self):
     """Trivial zoom test when the enclosure is the same as the circle."""
     input_ = circ._Circle(0, 0, 0.5)
     target = circ._Circle(0, 0, 1.0)
     actual = circ.scale(input_, target, input_)
     self.assertEqual(target, actual)
示例#6
0
 def test_simple_zoom_and_translation(self):
     """Pan and zoom test with off center circle equal to enclosure."""
     input = Circle(0.5, 0.5, 0.5)
     target = Circle(-0.5, 0, 1.0)
     actual = scale([input], input, target)
     self.assertEqual([target], actual)
示例#7
0
 def test_simple_zoom_off_center(self):
     """Zoom test with off center circle equal to enclosure."""
     input = Circle(0.5, 0.5, 0.5)
     target = Circle(0.5, 0.5, 1.0)
     actual = scale([input], input, target)
     self.assertEqual([target], actual)
示例#8
0
 def test_simple_zoom(self):
     """Trivial zoom test when the enclosure is the same as the circle."""
     input = Circle(0, 0, 0.5)
     target = Circle(0, 0, 1.0)
     actual = scale([input], input, target)
     self.assertEqual([target], actual)