Skip to content

Commit 6663aef

Browse files
committed
Fix pydot tests
1 parent 6d8c2a4 commit 6663aef

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

cwltool/cwlviewer.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ def _set_inner_edges(self) -> None:
8989
self._dot_graph.add_node(n)
9090
self._dot_graph.add_edge(
9191
pydot.Edge(
92-
str(inner_edge_row["source_step"]),
93-
str(inner_edge_row["target_step"]),
92+
pydot.quote_id_if_necessary(str(inner_edge_row["source_step"])),
93+
pydot.quote_id_if_necessary(str(inner_edge_row["target_step"])),
9494
)
9595
)
9696

@@ -100,7 +100,6 @@ def _set_input_edges(self) -> None:
100100
inputs_subgraph = pydot.Subgraph(graph_name="cluster_inputs")
101101
self._dot_graph.add_subgraph(inputs_subgraph)
102102
inputs_subgraph.set("rank", "same")
103-
inputs_subgraph.create_attribute_methods(["style"])
104103
inputs_subgraph.set("style", "dashed")
105104
inputs_subgraph.set("label", "Workflow Inputs")
106105

@@ -120,15 +119,19 @@ def _set_input_edges(self) -> None:
120119
)
121120
n.set_name(str(input_row["input"]))
122121
inputs_subgraph.add_node(n)
123-
self._dot_graph.add_edge(pydot.Edge(str(input_row["input"]), str(input_row["step"])))
122+
self._dot_graph.add_edge(
123+
pydot.Edge(
124+
pydot.quote_id_if_necessary(str(input_row["input"])),
125+
pydot.quote_id_if_necessary(str(input_row["step"])),
126+
)
127+
)
124128

125129
def _set_output_edges(self) -> None:
126130
with open(_get_output_edges_query_path) as f:
127131
get_output_edges = f.read()
128132
outputs_graph = pydot.Subgraph(graph_name="cluster_outputs")
129133
self._dot_graph.add_subgraph(outputs_graph)
130134
outputs_graph.set("rank", "same")
131-
outputs_graph.create_attribute_methods(["style"])
132135
outputs_graph.set("style", "dashed")
133136
outputs_graph.set("label", "Workflow Outputs")
134137
outputs_graph.set("labelloc", "b")
@@ -148,7 +151,12 @@ def _set_output_edges(self) -> None:
148151
)
149152
n.set_name(str(output_edge_row["output"]))
150153
outputs_graph.add_node(n)
151-
self._dot_graph.add_edge(pydot.Edge(output_edge_row["step"], output_edge_row["output"]))
154+
self._dot_graph.add_edge(
155+
pydot.Edge(
156+
pydot.quote_id_if_necessary(output_edge_row["step"]),
157+
pydot.quote_id_if_necessary(output_edge_row["output"]),
158+
)
159+
)
152160

153161
def _get_root_graph_uri(self) -> rdflib.term.Identifier:
154162
with open(_get_root_query_path) as f:

mypy-stubs/pydot.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ class Common:
2121
def get_attributes(self) -> Dict[str, str]: ...
2222
def set_sequence(self, seq: str) -> None: ...
2323
def get_sequence(self) -> str: ...
24-
def create_attribute_methods(self, obj_attributes: List[str]) -> None: ...
2524

2625
class Error(Exception):
2726
value: Any

0 commit comments

Comments
 (0)