diff --git a/tests/core/commands/test_log.py b/tests/core/commands/test_log.py index 5f3bbdcaf0..4f4eefd917 100644 --- a/tests/core/commands/test_log.py +++ b/tests/core/commands/test_log.py @@ -104,7 +104,7 @@ def test_log_dataset_create_simple(mocker): new_dataset = mocker.MagicMock() new_dataset.id = "new" new_dataset.slug = "ds" - new_dataset.title = None + new_dataset.name = None new_dataset.description = None new_dataset.derived_from = None new_dataset.same_as = None @@ -159,7 +159,7 @@ def test_log_dataset_create_complex(mocker): new_dataset.slug = "ds" new_dataset.derived_from = None new_dataset.same_as = None - new_dataset.title = "new-title" + new_dataset.name = "new-name" new_dataset.description = "new-description" new_dataset.dataset_files = [] new_dataset.creators = [mocker.MagicMock(full_identity="John")] @@ -193,7 +193,7 @@ def test_log_dataset_create_complex(mocker): assert "ds" == entry.id assert "Dataset 'ds': created" == entry.description - assert "new-title" == entry.details.name_changed + assert "new-name" == entry.details.name_changed assert "new-description" == entry.details.description_changed assert ["John"] == entry.details.creators_added assert not entry.details.files_added @@ -217,7 +217,7 @@ def test_log_dataset_add_create(mocker): new_dataset.slug = "ds" new_dataset.derived_from = None new_dataset.same_as = None - new_dataset.title = "new-title" + new_dataset.name = "new-name" new_dataset.description = "new-description" new_dataset.dataset_files = [ mocker.MagicMock(date_removed=None, entity=mocker.MagicMock(path="file_a")), @@ -251,7 +251,7 @@ def test_log_dataset_add_create(mocker): assert "ds" == entry.id assert "Dataset 'ds': created, 2 file(s) added" == entry.description - assert "new-title" == entry.details.name_changed + assert "new-name" == entry.details.name_changed assert "new-description" == entry.details.description_changed assert not entry.details.creators_added assert {"file_b", "file_a"} == set(entry.details.files_added) @@ -273,7 +273,7 @@ def test_log_dataset_import(mocker): new_dataset.id = "new" new_dataset.slug = "ds" new_dataset.derived_from = None - new_dataset.title = "new-title" + new_dataset.name = "new-name" new_dataset.description = "new-description" new_dataset.same_as = mocker.MagicMock(value="http://renkulab.io/my/dataset") new_dataset.dataset_files = [ @@ -308,7 +308,7 @@ def test_log_dataset_import(mocker): assert "ds" == entry.id assert "Dataset 'ds': imported, 2 file(s) added" == entry.description - assert "new-title" == entry.details.name_changed + assert "new-name" == entry.details.name_changed assert "new-description" == entry.details.description_changed assert not entry.details.creators_added assert {"file_b", "file_a"} == set(entry.details.files_added) @@ -338,7 +338,7 @@ def test_log_dataset_deleted(mocker): new_dataset = mocker.MagicMock() new_dataset.id = "new" new_dataset.slug = "ds" - new_dataset.title = None + new_dataset.name = None new_dataset.description = None new_dataset.derived_from = Url(url_id="old") new_dataset.same_as = None @@ -402,7 +402,7 @@ def test_log_dataset_files_removed(mocker): old_dataset = mocker.MagicMock() old_dataset.id = "old" old_dataset.slug = "ds" - old_dataset.title = None + old_dataset.name = None old_dataset.description = None old_dataset.derived_from = None old_dataset.same_as = None @@ -415,7 +415,7 @@ def test_log_dataset_files_removed(mocker): new_dataset = mocker.MagicMock() new_dataset.id = "new" new_dataset.slug = "ds" - new_dataset.title = None + new_dataset.name = None new_dataset.description = None new_dataset.derived_from = Url(url_id="old") new_dataset.same_as = None @@ -480,7 +480,7 @@ def test_log_dataset_metadata_modified(mocker): old_dataset = mocker.MagicMock() old_dataset.id = "old" old_dataset.slug = "ds" - old_dataset.title = "old-title" + old_dataset.name = "old-name" old_dataset.description = "old-description" old_dataset.dataset_files = [] old_dataset.creators = [mocker.MagicMock(full_identity="John")] @@ -494,7 +494,7 @@ def test_log_dataset_metadata_modified(mocker): new_dataset = mocker.MagicMock() new_dataset.id = "new" new_dataset.slug = "ds" - new_dataset.title = "new-title" + new_dataset.name = "new-name" new_dataset.description = "new-description" new_dataset.derived_from = Url(url_id="old") new_dataset.same_as = None @@ -540,7 +540,7 @@ def _mock_get_by_id(id): assert "ds" == entry.id assert "Dataset 'ds': metadata modified" == entry.description - assert "new-title" == entry.details.name_changed + assert "new-name" == entry.details.name_changed assert "new-description" == entry.details.description_changed assert not entry.details.files_added assert not entry.details.files_removed diff --git a/tests/core/commands/test_merge.py b/tests/core/commands/test_merge.py index 14358c4196..970396c891 100644 --- a/tests/core/commands/test_merge.py +++ b/tests/core/commands/test_merge.py @@ -45,7 +45,7 @@ def test_merge_dataset_tree_local_modified_dataset(mocker): """Test merging dataset tree with local modifications.""" dataset = Dataset(id=Dataset.generate_id(uuid4().hex), slug="dataset", name="First") modified_dataset = dataset.copy() - modified_dataset.update_metadata(title="Modified title") + modified_dataset.update_metadata(name="Modified name") modified_dataset.derive_from(dataset, creator=None) local = BTree({"dataset": modified_dataset}) @@ -59,14 +59,14 @@ def test_merge_dataset_tree_local_modified_dataset(mocker): merged = merger.merge_btrees(local, remote) assert "dataset" in merged.keys() - assert "Modified title" == merged["dataset"].title + assert "Modified name" == merged["dataset"].name def test_merge_dataset_tree_remote_modified_dataset(mocker): """Test merging dataset tree with remote modifications.""" - dataset = Dataset(id=Dataset.generate_id(uuid4().hex), name="dataset", title="First") + dataset = Dataset(id=Dataset.generate_id(uuid4().hex), slug="dataset", name="First") modified_dataset = dataset.copy() - modified_dataset.update_metadata(title="Modified title") + modified_dataset.update_metadata(name="Modified name") modified_dataset.derive_from(dataset, creator=None) local = BTree({"dataset": dataset}) @@ -80,20 +80,20 @@ def test_merge_dataset_tree_remote_modified_dataset(mocker): merged = merger.merge_btrees(local, remote) assert "dataset" in merged.keys() - assert "Modified title" == merged["dataset"].title + assert "Modified name" == merged["dataset"].name def test_merge_dataset_tree_both_modified_dataset(mocker): """Test merging dataset tree with remote and local modifications.""" - dataset = Dataset(id=Dataset.generate_id(uuid4().hex), name="dataset", title="First") + dataset = Dataset(id=Dataset.generate_id(uuid4().hex), slug="dataset", name="First") modified_local_dataset = dataset.copy() - modified_local_dataset.update_metadata(title="Modified local title") + modified_local_dataset.update_metadata(name="Modified local name") modified_local_dataset.derive_from(dataset, creator=None) modified_remote_dataset = dataset.copy() - modified_remote_dataset.update_metadata(title="Modified remote title") + modified_remote_dataset.update_metadata(name="Modified remote name") modified_remote_dataset.derive_from(dataset, creator=None) - unrelated_dataset = Dataset(id=Dataset.generate_id(uuid4().hex), name="unrelated_dataset", title="unrelated") + unrelated_dataset = Dataset(id=Dataset.generate_id(uuid4().hex), slug="unrelated_dataset", name="unrelated") all_datasets = [dataset, modified_local_dataset, modified_remote_dataset, unrelated_dataset] @@ -109,16 +109,16 @@ def test_merge_dataset_tree_both_modified_dataset(mocker): mocker.patch("renku.infrastructure.git_merger.communication.prompt", mocker.MagicMock(return_value="l")) merged = merger.merge_btrees(local, remote) assert "dataset" in merged.keys() - assert "Modified local title" == merged["dataset"].title + assert "Modified local name" == merged["dataset"].name assert "unrelated_dataset" in merged.keys() - assert "unrelated" == merged["unrelated_dataset"].title + assert "unrelated" == merged["unrelated_dataset"].name mocker.patch("renku.infrastructure.git_merger.communication.prompt", mocker.MagicMock(return_value="r")) merged = merger.merge_btrees(local, remote) assert "dataset" in merged.keys() - assert "Modified remote title" == merged["dataset"].title + assert "Modified remote name" == merged["dataset"].name assert "unrelated_dataset" in merged.keys() - assert "unrelated" == merged["unrelated_dataset"].title + assert "unrelated" == merged["unrelated_dataset"].name def test_merge_plan_tree_non_conflict_plan():