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

Method test_clone_basic

core/tests/python/tests/test_web.py:512–521  ·  view source on GitHub ↗

Test cloning an element.

(self)

Source from the content-addressed store, hash-verified

510 assert result.id == "child-id-2"
511
512 def test_clone_basic(self):
513 """Test cloning an element."""
514 original = web.div("Content", id="original")
515 original.classes.add("test-class")
516
517 clone = original.clone()
518 assert clone.innerHTML == original.innerHTML
519 assert "test-class" in clone.classes
520 assert clone is not original
521 assert clone._dom_element is not original._dom_element
522
523 def test_clone_with_id(self):
524 """Test cloning with new id."""

Callers

nothing calls this directly

Calls 2

addMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected