|
1 | 1 | from __future__ import unicode_literals
|
2 | 2 |
|
3 | 3 | import os
|
4 |
| -import boto3 |
5 | 4 | import filecmp
|
6 | 5 |
|
7 | 6 | import pytest
|
8 | 7 |
|
9 |
| -from moto import mock_s3 |
10 |
| - |
11 |
| -from dvc.remote import RemoteS3 |
12 | 8 | from dvc.repo import Repo
|
13 | 9 | from dvc.utils import makedirs
|
14 | 10 |
|
@@ -36,29 +32,3 @@ def test_get_url_to_dir(dname, repo_dir):
|
36 | 32 |
|
37 | 33 | assert os.path.isdir(dname)
|
38 | 34 | assert filecmp.cmp(repo_dir.DATA, dst, shallow=False)
|
39 |
| - |
40 |
| - |
41 |
| -@pytest.mark.parametrize("dst", [".", "./from"]) |
42 |
| -def test_get_url_from_non_local_path_to_dir_and_file(repo_dir, dst): |
43 |
| - with mock_s3(): |
44 |
| - file_name = "from" |
45 |
| - file_content = "data" |
46 |
| - base_info = RemoteS3.path_cls("s3://bucket/path") |
47 |
| - from_info = base_info / file_name |
48 |
| - |
49 |
| - s3 = boto3.client("s3") |
50 |
| - s3.create_bucket(Bucket=from_info.bucket) |
51 |
| - s3.put_object( |
52 |
| - Bucket=from_info.bucket, Key=from_info.path, Body=file_content |
53 |
| - ) |
54 |
| - |
55 |
| - Repo.get_url(from_info.url, dst) |
56 |
| - |
57 |
| - result_path = ( |
58 |
| - os.path.join(dst, file_name) if os.path.isdir(dst) else dst |
59 |
| - ) |
60 |
| - |
61 |
| - assert os.path.exists(result_path) |
62 |
| - assert os.path.isfile(result_path) |
63 |
| - with open(result_path, "r") as fd: |
64 |
| - assert fd.read() == file_content |
0 commit comments