MCPcopy Index your code
hub / github.com/pyscript/pyscript / test_getitem_by_id

Method test_getitem_by_id

core/tests/python/tests/test_web.py:492–500  ·  view source on GitHub ↗

Test looking up descendant by id.

(self)

Source from the content-addressed store, hash-verified

490 assert sliced[1].innerHTML == "Child 2"
491
492 def test_getitem_by_id(self):
493 """Test looking up descendant by id."""
494 child = web.p("Child", id="child-id")
495 parent = web.div(child)
496 web.page.body.append(parent)
497
498 result = parent["child-id"]
499 assert result is not None
500 assert result.id == "child-id"
501
502 def test_getitem_by_id_with_hash(self):
503 """Test looking up descendant by id with # prefix."""

Callers

nothing calls this directly

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected