Ejemplo n.º 1
0
 def test_scale_property(self):
     gen = mob_gen.MobjectGenerator(max_depth=0)
     obj = gen.next()
     og = copy.deepcopy(obj)
     obj.scale(10)
     np.testing.assert_array_less(np.absolute(og.get_all_points()),
                                  np.absolute(obj.get_all_points()))
Ejemplo n.º 2
0
 def test_center_positive_bound_object(self):
     gen = mob_gen.MobjectGenerator(lower_bound=1)
     obj = gen.next()
     og = copy.deepcopy(obj)
     obj.center()
     np.testing.assert_array_less(obj.get_all_points(), og.get_all_points())
Ejemplo n.º 3
0
 def test_shift_positive_property(self):
     gen = mob_gen.MobjectGenerator(max_depth=0)
     obj = gen.next()
     og = copy.deepcopy(obj)
     obj.shift(np.full((1, 3), random.Random().randrange(1, 1000)))
     np.testing.assert_array_less(og.get_all_points(), obj.get_all_points())
Ejemplo n.º 4
0
 def test_shift_by_zero_property(self):
     gen = mob_gen.MobjectGenerator(max_depth=0)
     obj = gen.next()
     og = obj.points
     obj.shift(np.zeros((1, 3)))
     np.testing.assert_array_equal(og, obj.points)