From cca25ba679d2ddf23eb4ff5c0d00fb5d14e2fdff Mon Sep 17 00:00:00 2001 From: capellancitizen Date: Tue, 23 Apr 2024 18:09:32 -0400 Subject: Clean-up of clone code (#2851) --- tests/test_clone.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'tests') diff --git a/tests/test_clone.py b/tests/test_clone.py index d8e64c9c..6ebb0796 100644 --- a/tests/test_clone.py +++ b/tests/test_clone.py @@ -34,6 +34,22 @@ class CloneElementTest(TestCase): stitch_groups = clone.to_stitch_groups(None) self.assertEqual(len(stitch_groups), 0) + def test_not_clone(self): + root: SvgDocumentElement = svg() + rect = root.add(Rectangle(attrib={ + "width": "10", + "height": "10", + INKSTITCH_ATTRIBS["angle"]: "30" + })) + use = root.add(Use(attrib={ + INKSTITCH_ATTRIBS["clone"]: "false" + })) + use.href = rect + + clone = Clone(use) + stitch_groups = clone.to_stitch_groups(None) + self.assertEqual(len(stitch_groups), 0) + # These tests make sure the element cloning works as expected, using the `clone_elements` method. def test_basic(self): -- cgit v1.2.3