Skip to content

Commit

Permalink
add a method:TEManager.add_breakdowns_to_connection(connection_reques…
Browse files Browse the repository at this point in the history
…t, breakdown)
  • Loading branch information
YufengXin committed May 29, 2024
1 parent b93722f commit 0c35331
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/sdx_pce/topology/temanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,11 @@ def get_links_on_path(self, solution: ConnectionSolution) -> list:

return result

def add_breakdowns_to_connection(self, connection_request: dict, breakdowns: dict):
connection_request["breakdowns"] = breakdowns

return connection_request

def generate_connection_breakdown(
self, solution: ConnectionSolution, connection_request: dict
) -> dict:
Expand Down
4 changes: 4 additions & 0 deletions tests/test_te_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,10 @@ def test_connection_amlight_to_zaoxi(self):
)
print(f"breakdown: {json.dumps(breakdown)}")

connection_request = temanager.add_breakdowns_to_connection(connection_request, breakdown)

temanager._logger.info(f"connection_request with breakdowns: {connection_request}")

# Note that the "domain" key is correct in the breakdown
# result when we initialize TEManager with None for topology,
# and later add individual topologies with add_topology().
Expand Down

0 comments on commit 0c35331

Please sign in to comment.