dvc: refactor PathInfos

Following same conventions from remotes/outsputs/dependencies.

Signed-off-by: Ruslan Kuprieiev <[email protected]>
This commit is contained in:
Ruslan Kuprieiev
2019-05-12 17:18:46 +03:00
parent d1881fd1b1
commit a593a9ce2e
35 changed files with 152 additions and 137 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
import os
import configobj
from dvc.path.local import LocalPathInfo
from dvc.path.local import PathLOCAL
from dvc.remote.base import RemoteBase
from mock import patch
@@ -199,7 +199,7 @@ def test_dir_checksum_should_be_key_order_agnostic(dvc):
with open(file2, "w") as fobj:
fobj.write("2")
path_info = LocalPathInfo(path=data_dir)
path_info = PathLOCAL(path=data_dir)
with dvc.state:
with patch.object(
RemoteBase,
+2 -2
View File
@@ -4,7 +4,7 @@ from copy import copy
import boto3
import pytest
from dvc.path.s3 import S3PathInfo
from dvc.path.s3 import PathS3
from dvc.remote.s3 import RemoteS3
from tests.func.test_data_cloud import TEST_AWS_REPO_BUCKET, _should_test_aws
@@ -12,7 +12,7 @@ from tests.func.test_data_cloud import TEST_AWS_REPO_BUCKET, _should_test_aws
def _get_src_dst():
prefix = str(uuid.uuid4())
from_info = S3PathInfo(
from_info = PathS3(
bucket=TEST_AWS_REPO_BUCKET, path=posixpath.join(prefix, "from")
)
to_info = copy(from_info)
+3 -3
View File
@@ -1,6 +1,6 @@
import os
import mock
from dvc.path.local import LocalPathInfo
from dvc.path.local import PathLOCAL
from dvc.utils.compat import str
@@ -15,7 +15,7 @@ from tests.basic_env import TestDvc
class TestState(TestDvc):
def test_update(self):
path = os.path.join(self.dvc.root_dir, self.FOO)
path_info = LocalPathInfo(path=path)
path_info = PathLOCAL(path=path)
md5 = file_md5(path)[0]
state = State(self.dvc, self.dvc.config.config)
@@ -78,6 +78,6 @@ class TestGetStateRecordForInode(TestDvc):
get_inode_mock.side_effect = self.mock_get_inode(path, inode)
with state:
state.save(LocalPathInfo(path=path), md5)
state.save(PathLOCAL(path=path), md5)
ret = state.get_state_record_for_inode(inode)
self.assertIsNotNone(ret)