summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2020-12-03 13:49:13 +0000
committerGerrit Code Review <review@openstack.org>2020-12-03 13:49:13 +0000
commit49e7a14d39b5f5475a976f3fafc40d0710eda4f1 (patch)
treec4c9ecddefccabc96b29f3a37190fe9c52360b00
parent13ca39be5efe4f45e70557e6512bbedea55eb301 (diff)
parentc1a722d771ad107de57abf4de76bc8bc18c346f7 (diff)
downloadtrove-49e7a14d39b5f5475a976f3fafc40d0710eda4f1.tar.gz
Merge "use HTTPStatus instead of http.client"
-rw-r--r--trove/tests/fakes/swift.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/trove/tests/fakes/swift.py b/trove/tests/fakes/swift.py
index acc1a46b..bd2da58e 100644
--- a/trove/tests/fakes/swift.py
+++ b/trove/tests/fakes/swift.py
@@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
-from http import client as http_client
+import http
from hashlib import md5
from unittest.mock import MagicMock, patch
import json
@@ -78,10 +78,12 @@ class FakeSwiftConnection(object):
LOG.debug("fake head_container(%s)", container)
if container == 'missing_container':
raise swift.ClientException('fake exception',
- http_status=http_client.NOT_FOUND)
+ http_status=http.HTTPStatus.NOT_FOUND)
elif container == 'unauthorized_container':
- raise swift.ClientException('fake exception',
- http_status=http_client.UNAUTHORIZED)
+ raise swift.ClientException(
+ 'fake exception',
+ http_status=http.HTTPStatus.UNAUTHORIZED
+ )
elif container == 'socket_error_on_head':
raise socket.error(111, 'ECONNREFUSED')
pass