remove application from library
Python CI / test (push) Failing after 6m29s

This commit is contained in:
2025-11-07 18:48:36 +01:00
parent 6bb43db8d5
commit 33e2cbc363
21 changed files with 1747 additions and 2656 deletions
+16 -13
View File
@@ -18,11 +18,11 @@ from pyWebLayout.core.base import Renderable, Queriable
class SimpleTestRenderable(Renderable, Queriable):
"""A simple test renderable for testing the page system"""
def __init__(self, text: str, size: tuple = (100, 50)):
self._text = text
self.size = size
self.origin = np.array([0, 0])
self._origin = np.array([0, 0])
def render(self):
"""Render returns None - drawing is done via the page's draw object"""
@@ -145,25 +145,28 @@ class TestPageImplementation(unittest.TestCase):
def test_page_query_point(self):
"""Test querying points to find children"""
page = Page(size=(400, 300))
# Add children with known positions and sizes
child1 = SimpleTestRenderable("Child 1", (100, 50))
child2 = SimpleTestRenderable("Child 2", (80, 40))
page.add_child(child1).add_child(child2)
# Query points
# Point within first child
found_child = page.query_point((90, 30))
self.assertEqual(found_child, child1)
result = page.query_point((90, 30))
self.assertIsNotNone(result)
self.assertEqual(result.object, child1)
# Point within second child
found_child = page.query_point((30, 30))
self.assertEqual(found_child, child2)
# Point outside any child
found_child = page.query_point((300, 250))
self.assertIsNone(found_child)
result = page.query_point((30, 30))
self.assertIsNotNone(result)
self.assertEqual(result.object, child2)
# Point outside any child - returns QueryResult with object_type "empty"
result = page.query_point((300, 250))
self.assertIsNotNone(result)
self.assertEqual(result.object_type, "empty")
def test_page_in_object(self):
"""Test that page correctly implements in_object"""