mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
fs: remove unused RemoteCmdError
This commit is contained in:
@@ -18,14 +18,6 @@ from dvc.utils.fs import makedirs, move
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class RemoteCmdError(DvcException):
|
||||
def __init__(self, remote, cmd, ret, err):
|
||||
super().__init__(
|
||||
"{remote} command '{cmd}' finished with non-zero return code"
|
||||
" {ret}': {err}".format(remote=remote, cmd=cmd, ret=ret, err=err)
|
||||
)
|
||||
|
||||
|
||||
class RemoteActionNotImplemented(DvcException):
|
||||
def __init__(self, action, scheme):
|
||||
m = f"{action} is not supported for {scheme} remotes"
|
||||
|
||||
@@ -2,9 +2,7 @@ import math
|
||||
import posixpath
|
||||
from unittest import mock
|
||||
|
||||
import pytest
|
||||
|
||||
from dvc.fs.base import FileSystem, RemoteCmdError
|
||||
from dvc.fs.base import FileSystem
|
||||
from dvc.objects.db.base import ObjectDB
|
||||
|
||||
|
||||
@@ -18,22 +16,6 @@ class _CallableOrNone:
|
||||
CallableOrNone = _CallableOrNone()
|
||||
|
||||
|
||||
def test_cmd_error(dvc):
|
||||
config = {}
|
||||
|
||||
cmd = "sed 'hello'"
|
||||
ret = "1"
|
||||
err = "sed: expression #1, char 2: extra characters after command"
|
||||
|
||||
with mock.patch.object(
|
||||
FileSystem,
|
||||
"remove",
|
||||
side_effect=RemoteCmdError("base", cmd, ret, err),
|
||||
):
|
||||
with pytest.raises(RemoteCmdError):
|
||||
FileSystem(**config).remove("file")
|
||||
|
||||
|
||||
@mock.patch.object(ObjectDB, "_list_hashes_traverse")
|
||||
@mock.patch.object(ObjectDB, "list_hashes_exists")
|
||||
def test_hashes_exist(object_exists, traverse, dvc):
|
||||
|
||||
Reference in New Issue
Block a user