Merge "Make tests in test_hrefs, test_quota py3 compatible"
This commit is contained in:
commit
cb48973afd
@ -17,18 +17,11 @@
|
|||||||
Barbican exception subclasses
|
Barbican exception subclasses
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import urlparse
|
|
||||||
|
|
||||||
from barbican import i18n as u
|
from barbican import i18n as u
|
||||||
|
|
||||||
_FATAL_EXCEPTION_FORMAT_ERRORS = False
|
_FATAL_EXCEPTION_FORMAT_ERRORS = False
|
||||||
|
|
||||||
|
|
||||||
class RedirectException(Exception):
|
|
||||||
def __init__(self, url):
|
|
||||||
self.url = urlparse.urlparse(url)
|
|
||||||
|
|
||||||
|
|
||||||
class BarbicanException(Exception):
|
class BarbicanException(Exception):
|
||||||
"""Base Barbican Exception
|
"""Base Barbican Exception
|
||||||
|
|
||||||
|
@ -17,12 +17,12 @@ import functools
|
|||||||
from os import path
|
from os import path
|
||||||
import time
|
import time
|
||||||
import types
|
import types
|
||||||
import urlparse
|
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
import mock
|
import mock
|
||||||
import oslotest.base as oslotest
|
import oslotest.base as oslotest
|
||||||
import six
|
import six
|
||||||
|
from six.moves.urllib import parse
|
||||||
import webtest
|
import webtest
|
||||||
|
|
||||||
from OpenSSL import crypto
|
from OpenSSL import crypto
|
||||||
@ -408,7 +408,7 @@ def create_timestamp_w_tz_and_offset(timezone=None, days=0, hours=0, minutes=0,
|
|||||||
|
|
||||||
|
|
||||||
def get_limit_and_offset_from_ref(ref):
|
def get_limit_and_offset_from_ref(ref):
|
||||||
matches = dict(urlparse.parse_qsl(urlparse.urlparse(ref).query))
|
matches = dict(parse.parse_qsl(parse.urlparse(ref).query))
|
||||||
ref_limit = matches['limit']
|
ref_limit = matches['limit']
|
||||||
ref_offset = matches['offset']
|
ref_offset = matches['offset']
|
||||||
|
|
||||||
|
4
tox.ini
4
tox.ini
@ -27,7 +27,9 @@ deps = -r{toxinidir}/requirements.txt
|
|||||||
|
|
||||||
commands =
|
commands =
|
||||||
python -m testtools.run \
|
python -m testtools.run \
|
||||||
barbican.tests.common.test_utils
|
barbican.tests.common.test_utils \
|
||||||
|
barbican.tests.common.test_hrefs \
|
||||||
|
barbican.tests.common.test_quota
|
||||||
|
|
||||||
[testenv:pep8]
|
[testenv:pep8]
|
||||||
sitepackages = False
|
sitepackages = False
|
||||||
|
Loading…
x
Reference in New Issue
Block a user