MCPcopy Index your code
hub / github.com/OmkarPathak/pygorithm / test_repr

Method test_repr

tests/test_data_structure.py:761–773  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

759 self.assertAlmostEqual(8/6, _tree.calculate_weight_misplaced_ents()) # 1 misplaced (2 deep), 6 total
760
761 def test_repr(self):
762 _tree = quadtree.QuadTree(1, 5, rect2.Rect2(100, 100))
763
764 _tree.insert_and_think(quadtree.QuadTreeEntity(rect2.Rect2(2, 2, vector2.Vector2(5, 5))))
765 _tree.insert_and_think(quadtree.QuadTreeEntity(rect2.Rect2(2, 2, vector2.Vector2(95, 5))))
766
767 _olddiff = self.maxDiff
768 def cleanup(self2=self):
769 self2.maxDiff = _olddiff
770
771 self.addCleanup(cleanup)
772 self.maxDiff = None
773 self.assertEqual("quadtree(bucket_size=1, max_depth=5, location=rect2(width=100, height=100, mincorner=vector2(x=0, y=0)), depth=0, entities=[], children=[quadtree(bucket_size=1, max_depth=5, location=rect2(width=50.0, height=50.0, mincorner=vector2(x=0, y=0)), depth=1, entities=[quadtreeentity(aabb=rect2(width=2, height=2, mincorner=vector2(x=5, y=5)))], children=None), quadtree(bucket_size=1, max_depth=5, location=rect2(width=50.0, height=50.0, mincorner=vector2(x=50.0, y=0)), depth=1, entities=[quadtreeentity(aabb=rect2(width=2, height=2, mincorner=vector2(x=95, y=5)))], children=None), quadtree(bucket_size=1, max_depth=5, location=rect2(width=50.0, height=50.0, mincorner=vector2(x=50.0, y=50.0)), depth=1, entities=[], children=None), quadtree(bucket_size=1, max_depth=5, location=rect2(width=50.0, height=50.0, mincorner=vector2(x=0, y=50.0)), depth=1, entities=[], children=None)])", repr(_tree))
774
775 def test_str(self):
776 _tree = quadtree.QuadTree(1, 5, rect2.Rect2(100, 100))

Callers

nothing calls this directly

Calls 1

insert_and_thinkMethod · 0.95

Tested by

no test coverage detected