Skip to content

Commit

Permalink
test: Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
huyenngn committed Oct 16, 2024
1 parent 9a51ed6 commit 94517e0
Show file tree
Hide file tree
Showing 3 changed files with 421 additions and 413 deletions.
15 changes: 9 additions & 6 deletions capella_ros_tools/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,16 @@ def to_yaml(
"""Import ROS messages into a Capella data package."""
logger.info("Generating decl YAML")

instructions = [
{"parent": decl.UUIDReference(helpers.UUIDString(root_uuid))}
| self._convert_package(self.messages),
]
needed_types = [
p for p in self._promise_id_refs if p not in self._promise_ids
]

logger.info("Needed types: %s", needed_types)

associations = []
for prop_promise_id, promise_id in self._needed_associations.items():
if prop_promise_id in needed_types:
Expand Down Expand Up @@ -243,13 +249,10 @@ def to_yaml(
}
)

root_package = self._convert_package(self.messages)
root_package["sync"]["owned_associations"] = associations
logger.info("Associations: %s", associations)

instructions[0]["sync"]["owned_associations"] = associations

instructions = [
{"parent": decl.UUIDReference(helpers.UUIDString(root_uuid))}
| root_package,
]
if not needed_types:
return decl.dump(instructions)

Expand Down
Loading

0 comments on commit 94517e0

Please sign in to comment.