mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Merge branch 'release_24.0' into dev
This commit is contained in:
@@ -25,10 +25,10 @@ def job_connections_manager(sa_session) -> JobConnectionsManager:
|
||||
|
||||
# =============================================================================
|
||||
def setup_connected_dataset(sa_session: galaxy_scoped_session):
|
||||
center_hda = HistoryDatasetAssociation(sa_session=sa_session)
|
||||
input_hda = HistoryDatasetAssociation(sa_session=sa_session)
|
||||
center_hda = HistoryDatasetAssociation(sa_session=sa_session, create_dataset=True)
|
||||
input_hda = HistoryDatasetAssociation(sa_session=sa_session, create_dataset=True)
|
||||
input_hdca = HistoryDatasetCollectionAssociation()
|
||||
output_hda = HistoryDatasetAssociation(sa_session=sa_session)
|
||||
output_hda = HistoryDatasetAssociation(sa_session=sa_session, create_dataset=True)
|
||||
output_hdca = HistoryDatasetCollectionAssociation()
|
||||
input_job = Job()
|
||||
output_job = Job()
|
||||
@@ -56,10 +56,10 @@ def setup_connected_dataset(sa_session: galaxy_scoped_session):
|
||||
|
||||
def setup_connected_dataset_collection(sa_session: galaxy_scoped_session):
|
||||
center_hdca = HistoryDatasetCollectionAssociation()
|
||||
input_hda1 = HistoryDatasetAssociation(sa_session=sa_session)
|
||||
input_hda2 = HistoryDatasetAssociation(sa_session=sa_session)
|
||||
input_hda1 = HistoryDatasetAssociation(sa_session=sa_session, create_dataset=True)
|
||||
input_hda2 = HistoryDatasetAssociation(sa_session=sa_session, create_dataset=True)
|
||||
input_hdca = HistoryDatasetCollectionAssociation()
|
||||
output_hda = HistoryDatasetAssociation(sa_session=sa_session)
|
||||
output_hda = HistoryDatasetAssociation(sa_session=sa_session, create_dataset=True)
|
||||
output_hdca = HistoryDatasetCollectionAssociation()
|
||||
input_job = Job()
|
||||
output_job = Job()
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
from uuid import uuid4
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
from galaxy.schema.schema import DatasetStateField
|
||||
from galaxy.schema.tasks import (
|
||||
GenerateInvocationDownload,
|
||||
RequestUser,
|
||||
@@ -22,3 +25,12 @@ def test_task_schema():
|
||||
assert rehydrated_download.invocation_id == TEST_INVOCATION_ID
|
||||
assert rehydrated_download.user.user_id == TEST_USER_ID
|
||||
assert rehydrated_download.galaxy_url == TEST_GALAXY_URL
|
||||
|
||||
|
||||
class StateModel(BaseModel):
|
||||
state: DatasetStateField
|
||||
|
||||
|
||||
def test_dataset_state_coercion():
|
||||
assert StateModel(state="ok").state == "ok"
|
||||
assert StateModel(state="deleted").state == "discarded"
|
||||
|
||||
@@ -38,3 +38,26 @@ def test_simple_assert_to_test_assert_list():
|
||||
|
||||
def test_assert_legacy_same_as_new_list_style():
|
||||
assert to_test_assert_list(ASSERT_THAT_LIST) == to_test_assert_list(ASSERT_THAT_LIST)
|
||||
|
||||
|
||||
NESTED_ASSERT_LIST = yaml.safe_load(
|
||||
"""
|
||||
- has_archive_member:
|
||||
path: ".*"
|
||||
asserts:
|
||||
- has_text:
|
||||
text: "a text"
|
||||
- has_text:
|
||||
text: "another text"
|
||||
"""
|
||||
)
|
||||
|
||||
|
||||
def test_nested_asserts():
|
||||
asserts = to_test_assert_list(NESTED_ASSERT_LIST)
|
||||
assert asserts and len(asserts) == 1
|
||||
assert asserts and asserts[0]["children"] and len(asserts[0]["children"]) == 2
|
||||
assert asserts and asserts[0]["children"] and asserts[0]["children"][0]["tag"] == "has_text"
|
||||
assert asserts and asserts[0]["children"] and asserts[0]["children"][0]["attributes"]["text"] == "a text"
|
||||
assert asserts and asserts[0]["children"] and asserts[0]["children"][1]["tag"] == "has_text"
|
||||
assert asserts and asserts[0]["children"] and asserts[0]["children"][1]["attributes"]["text"] == "another text"
|
||||
|
||||
Reference in New Issue
Block a user