1010from galaxy .managers .datasets import DatasetManager
1111from galaxy .managers .hdas import HDAManager
1212from galaxy .managers .histories import HistoryManager
13- from galaxy .managers .history_graph import HistoryGraphBuilder
13+ from galaxy .managers .history_graph import HistoryGraphManager
1414from .base import (
1515 BaseTestCase ,
1616 CreatesCollectionsMixin ,
@@ -35,6 +35,8 @@ def set_up_managers(self):
3535 self .hda_manager = self .app [HDAManager ]
3636 self .history_manager = self .app [HistoryManager ]
3737 self .collection_manager = self .app [DatasetCollectionManager ]
38+ self .app ._toolbox = None # type: ignore[assignment]
39+ self .history_graph_manager = self .app [HistoryGraphManager ]
3840
3941 def _build_graph (
4042 self ,
@@ -45,17 +47,15 @@ def _build_graph(
4547 limit = 500 ,
4648 seed_scope_hid = None ,
4749 ):
48- builder = HistoryGraphBuilder (
50+ return self . history_graph_manager . build (
4951 sa_session = self .trans .sa_session ,
50- security = self .app .security ,
5152 history_id = history .id ,
5253 limit = limit ,
5354 seed = seed ,
5455 direction = direction ,
5556 depth = depth ,
5657 seed_scope_hid = seed_scope_hid ,
5758 )
58- return builder .build ()
5959
6060 def _encode (self , prefix , db_id ):
6161 return f"{ prefix } { self .app .security .encode_id (db_id )} "
@@ -580,13 +580,11 @@ def test_deleted_items_with_include_deleted(self):
580580 assert len (graph .nodes ) == 0
581581
582582 # With include_deleted: included
583- builder = HistoryGraphBuilder (
583+ graph = self . history_graph_manager . build (
584584 sa_session = self .trans .sa_session ,
585- security = self .app .security ,
586585 history_id = history .id ,
587586 include_deleted = True ,
588587 )
589- graph = builder .build ()
590588 assert len (graph .nodes ) == 1
591589
592590 def test_expanding_limit_generally_additive (self ):
@@ -1015,13 +1013,11 @@ def test_n2_ambiguous_hdca_producer_has_node_but_no_edge(self):
10151013 hdca .implicit_collection_jobs_id = icj .id # implicit branch
10161014 self .trans .sa_session .flush ()
10171015
1018- builder = HistoryGraphBuilder (
1016+ graph = self . history_graph_manager . build (
10191017 sa_session = self .trans .sa_session ,
1020- security = self .app .security ,
10211018 history_id = history .id ,
10221019 limit = 500 ,
10231020 )
1024- graph = builder .build ()
10251021
10261022 hdca_enc = self ._encode ("c" , hdca .id )
10271023 node_ids = {n .id for n in graph .nodes }
@@ -1181,15 +1177,15 @@ def set_up_managers(self):
11811177 self .hda_manager = self .app [HDAManager ]
11821178 self .history_manager = self .app [HistoryManager ]
11831179 self .collection_manager = self .app [DatasetCollectionManager ]
1180+ self .app ._toolbox = None # type: ignore[assignment]
1181+ self .history_graph_manager = self .app [HistoryGraphManager ]
11841182
11851183 def _build_graph (self , history , ** kwargs ):
1186- builder = HistoryGraphBuilder (
1184+ return self . history_graph_manager . build (
11871185 sa_session = self .trans .sa_session ,
1188- security = self .app .security ,
11891186 history_id = history .id ,
11901187 ** kwargs ,
11911188 )
1192- return builder .build ()
11931189
11941190 def _encode (self , prefix , db_id ):
11951191 return f"{ prefix } { self .app .security .encode_id (db_id )} "
0 commit comments