@@ -110,16 +110,32 @@ def test_plotters_hierarchy(pipeline: NetworkOperation, inputs, outputs):
110110 solution = pipeline .compute (inputs , outputs )
111111
112112 # Plotting delegates to netwrok plan.
113- plan_dot = str (pipeline .plot (inputs = inputs , outputs = outputs ))
113+ netop_dot = str (pipeline .plot (inputs = inputs , outputs = outputs ))
114+ assert netop_dot
115+ assert netop_dot != base_dot
116+ assert pipeline .name in str (netop_dot )
117+
118+ # Plotting plan alone has not label.
119+ plan_dot = str (pipeline .last_plan .plot (inputs = inputs , outputs = outputs ))
114120 assert plan_dot
115121 assert plan_dot != base_dot
116- assert pipeline .name in str (plan_dot )
122+ assert plan_dot != netop_dot
123+ assert pipeline .name not in str (plan_dot )
117124
118125 # Plot a plan + solution, which must be different from all before.
119- sol_plan_dot = str (pipeline .plot (inputs = inputs , outputs = outputs , solution = solution ))
120- assert sol_plan_dot != base_dot
121- assert sol_plan_dot != plan_dot
122- assert pipeline .name in str (plan_dot )
126+ sol_netop_dot = str (
127+ pipeline .plot (inputs = inputs , outputs = outputs , solution = solution )
128+ )
129+ assert sol_netop_dot != base_dot
130+ assert sol_netop_dot != netop_dot
131+ assert sol_netop_dot != plan_dot
132+ assert pipeline .name in str (netop_dot )
133+
134+ # Plot a solution, which must equal plan + sol.
135+ sol_plan_dot = str (
136+ pipeline .last_plan .plot (inputs = inputs , outputs = outputs , solution = solution )
137+ )
138+ assert str (solution .plot (inputs = inputs , outputs = outputs )) == sol_plan_dot
123139
124140 plan = pipeline .last_plan
125141 pipeline .last_plan = None
0 commit comments