Skip to content

test: internalize external documents #2109

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/changelog.d/2109.test.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Internalize external documents
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
28 changes: 28 additions & 0 deletions tests/integration/test_design_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -535,3 +535,31 @@ def test_design_insert_id_bug(modeler: Modeler):

assert len(design1.components[0].bodies) == 1
assert len(design1.components[1].bodies) == 1


def test_import_scdocx_with_external_docs(modeler: Modeler):
"""Test importing an SCDOCX file with external documents and verify it is internalized."""
# Create a new design
design = modeler.create_design("Insert External Document")

# Define the path to the external SCDOCX file
path_to_external_doc = Path(FILES_DIR, "external_file_scdocx", "Design1.scdocx")

# Import the external SCDOCX file
design.insert_file(file_location=path_to_external_doc)

# Verify that the design structure is internalized
# Check the number of bodies in the design
assert len(design.bodies) == 0

# Check the number of components in the design
assert len(design.components) == 1

# Check the number of bodies in the first component
assert len(design.components[0].bodies) == 1

# Check the number of subcomponents in the first component
assert len(design.components[0].components) == 5

for component in design.components[0].components:
assert len(component.bodies) == 1
Loading