def build_tool_tests(self, testing_shed_tools=None, return_test_classes=False): if self.app is None: return if testing_shed_tools is None: testing_shed_tools = getattr(self, "testing_shed_tools", False) # We must make sure that functional.test_toolbox is always imported after # database_contexts.galaxy_content is set (which occurs in this method above). # If functional.test_toolbox is imported before database_contexts.galaxy_content # is set, sa_session will be None in all methods that use it. import functional.test_toolbox functional.test_toolbox.toolbox = self.app.toolbox # When testing data managers, do not test toolbox. test_classes = functional.test_toolbox.build_tests( app=self.app, testing_shed_tools=testing_shed_tools, master_api_key=get_admin_api_key(), user_api_key=get_user_api_key(), ) if return_test_classes: return test_classes return functional.test_toolbox
def build_tests(self): """Build data manager test methods.""" import functional.test_data_managers functional.test_data_managers.data_managers = self.app.data_managers functional.test_data_managers.build_tests( tmp_dir=self.galaxy_test_tmp_dir, testing_shed_tools=self.testing_shed_tools, master_api_key=get_admin_api_key(), user_api_key=get_user_api_key(), user_email=self.app.config.admin_users_list[0], create_admin=True, )
def run_tool_test(self, tool_id, index=0, resource_parameters={}): host, port, url = target_url_parts() galaxy_interactor_kwds = { "galaxy_url": url, "master_api_key": get_master_api_key(), "api_key": get_user_api_key(), "keep_outputs_dir": None, } galaxy_interactor = GalaxyInteractorApi(**galaxy_interactor_kwds) verify_tool(tool_id=tool_id, test_index=index, galaxy_interactor=galaxy_interactor, resource_parameters=resource_parameters)
def _setup_interactor(self): self.user_api_key = get_user_api_key() self.master_api_key = get_master_api_key() self.galaxy_interactor = ApiTestInteractor(self)