Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions faculty/datasets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,9 @@ def mv(source_path, destination_path, project_id=None, object_client=None):
project_id = project_id or get_context().project_id
object_client = object_client or ObjectClient(get_session())

if source_path == destination_path:
return

cp(
source_path,
destination_path,
Expand Down
10 changes: 10 additions & 0 deletions tests/datasets/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,16 @@ def test_mv(mocker, mock_client):
)


def test_mv_identical_source_and_destination(mocker, mock_client):
cp_mock = mocker.patch("faculty.datasets.cp")
rm_mock = mocker.patch("faculty.datasets.rm")

datasets.mv("source-path", "source-path", project_id=PROJECT_ID)

cp_mock.assert_not_called()
rm_mock.assert_not_called()


def test_etag(mocker, mock_client):
object_mock = mocker.Mock()
object_mock.etag = "test-etag"
Expand Down