689e370140
Signed-off-by: Alexander Gerasiov <gerasiov@yandex-team.ru>
164 lines
6.5 KiB
Diff
164 lines
6.5 KiB
Diff
From: TANIGUCHI Takaki <takaki@asis.media-as.org>
|
|
Date: Tue, 24 Nov 2015 21:34:20 +0900
|
|
Subject: Don't use duplicated modules (in tests)
|
|
|
|
---
|
|
tests/integration/test_glacier.py | 2 +-
|
|
tests/integration/test_s3.py | 8 ++++----
|
|
tests/integration/test_smoke.py | 6 +++---
|
|
tests/unit/auth/test_signers.py | 2 +-
|
|
tests/unit/test_awsrequest.py | 2 +-
|
|
tests/unit/test_endpoint.py | 2 +-
|
|
tests/unit/test_response.py | 2 +-
|
|
tests/unit/test_retryhandler.py | 4 ++--
|
|
tests/unit/test_utils.py | 2 +-
|
|
9 files changed, 15 insertions(+), 15 deletions(-)
|
|
|
|
diff --git a/tests/integration/test_glacier.py b/tests/integration/test_glacier.py
|
|
index 23a7f34..96cedf0 100644
|
|
--- a/tests/integration/test_glacier.py
|
|
+++ b/tests/integration/test_glacier.py
|
|
@@ -13,7 +13,7 @@
|
|
from tests import unittest
|
|
|
|
from botocore.exceptions import ClientError
|
|
-from botocore.vendored import six
|
|
+import six
|
|
import botocore.session
|
|
|
|
|
|
diff --git a/tests/integration/test_s3.py b/tests/integration/test_s3.py
|
|
index 1f07ef0..84962ed 100644
|
|
--- a/tests/integration/test_s3.py
|
|
+++ b/tests/integration/test_s3.py
|
|
@@ -25,13 +25,13 @@ from contextlib import closing
|
|
|
|
from nose.plugins.attrib import attr
|
|
|
|
-from botocore.vendored.requests import adapters
|
|
-from botocore.vendored.requests.exceptions import ConnectionError
|
|
+from requests import adapters
|
|
+from requests.exceptions import ConnectionError
|
|
from botocore.compat import six, zip_longest
|
|
import botocore.session
|
|
import botocore.auth
|
|
import botocore.credentials
|
|
-import botocore.vendored.requests as requests
|
|
+import requests
|
|
from botocore.config import Config
|
|
from botocore.exceptions import ClientError
|
|
|
|
@@ -823,7 +823,7 @@ class TestS3SigV4Client(BaseS3ClientTest):
|
|
raise ConnectionError("Simulated ConnectionError raised.")
|
|
else:
|
|
return original_send(self, *args, **kwargs)
|
|
- with mock.patch('botocore.vendored.requests.adapters.HTTPAdapter.send',
|
|
+ with mock.patch('requests.adapters.HTTPAdapter.send',
|
|
mock_http_adapter_send):
|
|
response = self.client.put_object(Bucket=self.bucket_name,
|
|
Key='foo.txt', Body=body)
|
|
diff --git a/tests/integration/test_smoke.py b/tests/integration/test_smoke.py
|
|
index 76bcded..85ef5d0 100644
|
|
--- a/tests/integration/test_smoke.py
|
|
+++ b/tests/integration/test_smoke.py
|
|
@@ -19,8 +19,8 @@ from nose.tools import assert_equal, assert_true
|
|
from botocore import xform_name
|
|
import botocore.session
|
|
from botocore.client import ClientError
|
|
-from botocore.vendored.requests import adapters
|
|
-from botocore.vendored.requests.exceptions import ConnectionError
|
|
+from requests import adapters
|
|
+from requests.exceptions import ConnectionError
|
|
|
|
|
|
# Mapping of service -> api calls to try.
|
|
@@ -292,7 +292,7 @@ def _make_client_call_with_errors(client, operation_name, kwargs):
|
|
raise ConnectionError("Simulated ConnectionError raised.")
|
|
else:
|
|
return original_send(self, *args, **kwargs)
|
|
- with mock.patch('botocore.vendored.requests.adapters.HTTPAdapter.send',
|
|
+ with mock.patch('requests.adapters.HTTPAdapter.send',
|
|
mock_http_adapter_send):
|
|
try:
|
|
response = operation(**kwargs)
|
|
diff --git a/tests/unit/auth/test_signers.py b/tests/unit/auth/test_signers.py
|
|
index d3dfab9..8f7b28f 100644
|
|
--- a/tests/unit/auth/test_signers.py
|
|
+++ b/tests/unit/auth/test_signers.py
|
|
@@ -24,7 +24,7 @@ import botocore.auth
|
|
import botocore.credentials
|
|
from botocore.compat import HTTPHeaders, urlsplit, parse_qs, six
|
|
from botocore.awsrequest import AWSRequest
|
|
-from botocore.vendored.requests.models import Request
|
|
+from requests.models import Request
|
|
|
|
|
|
class BaseTestWithFixedDate(unittest.TestCase):
|
|
diff --git a/tests/unit/test_awsrequest.py b/tests/unit/test_awsrequest.py
|
|
index d37aa24..e43d627 100644
|
|
--- a/tests/unit/test_awsrequest.py
|
|
+++ b/tests/unit/test_awsrequest.py
|
|
@@ -418,7 +418,7 @@ class TestAWSHTTPConnection(unittest.TestCase):
|
|
conn.sock = s
|
|
# Test that the standard library method was used by patching out
|
|
# the ``_tunnel`` method and seeing if the std lib method was called.
|
|
- with patch('botocore.vendored.requests.packages.urllib3.connection.'
|
|
+ with patch('requests.packages.urllib3.connection.'
|
|
'HTTPConnection._tunnel') as mock_tunnel:
|
|
conn._tunnel()
|
|
self.assertTrue(mock_tunnel.called)
|
|
diff --git a/tests/unit/test_endpoint.py b/tests/unit/test_endpoint.py
|
|
index fff84b0..2f266a4 100644
|
|
--- a/tests/unit/test_endpoint.py
|
|
+++ b/tests/unit/test_endpoint.py
|
|
@@ -14,7 +14,7 @@
|
|
from tests import unittest
|
|
|
|
from mock import Mock, patch, sentinel
|
|
-from botocore.vendored.requests import ConnectionError
|
|
+from requests import ConnectionError
|
|
|
|
from botocore.compat import six
|
|
from botocore.awsrequest import AWSRequest
|
|
diff --git a/tests/unit/test_response.py b/tests/unit/test_response.py
|
|
index 39daf58..2b8787d 100644
|
|
--- a/tests/unit/test_response.py
|
|
+++ b/tests/unit/test_response.py
|
|
@@ -20,7 +20,7 @@ import botocore
|
|
from botocore import response
|
|
from botocore.compat import six
|
|
from botocore.exceptions import IncompleteReadError
|
|
-from botocore.vendored.requests.models import Response, Request
|
|
+from requests.models import Response, Request
|
|
|
|
XMLBODY1 = (b'<?xml version="1.0" encoding="UTF-8"?><Error>'
|
|
b'<Code>AccessDenied</Code>'
|
|
diff --git a/tests/unit/test_retryhandler.py b/tests/unit/test_retryhandler.py
|
|
index 3f31a69..a6f05b8 100644
|
|
--- a/tests/unit/test_retryhandler.py
|
|
+++ b/tests/unit/test_retryhandler.py
|
|
@@ -16,8 +16,8 @@
|
|
from tests import unittest
|
|
|
|
import mock
|
|
-from botocore.vendored.requests import ConnectionError, Timeout
|
|
-from botocore.vendored.requests.packages.urllib3.exceptions import ClosedPoolError
|
|
+from requests import ConnectionError, Timeout
|
|
+from urllib3.exceptions import ClosedPoolError
|
|
|
|
from botocore import retryhandler
|
|
from botocore.exceptions import ChecksumError
|
|
diff --git a/tests/unit/test_utils.py b/tests/unit/test_utils.py
|
|
index 054aee4..5842674 100644
|
|
--- a/tests/unit/test_utils.py
|
|
+++ b/tests/unit/test_utils.py
|
|
@@ -25,7 +25,7 @@ from botocore.exceptions import InvalidExpressionError, ConfigNotFound
|
|
from botocore.exceptions import ClientError
|
|
from botocore.exceptions import InvalidDNSNameError, MetadataRetrievalError
|
|
from botocore.model import ServiceModel
|
|
-from botocore.vendored import requests
|
|
+import requests
|
|
from botocore.utils import is_json_value_header
|
|
from botocore.utils import remove_dot_segments
|
|
from botocore.utils import normalize_url_path
|