Merge "Raise hacking version to 2.0.0"
This commit is contained in:
commit
dea742c940
|
@ -14,9 +14,7 @@
|
|||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
"""
|
||||
OpenStack Client interface. Handles the REST calls and responses.
|
||||
"""
|
||||
"""OpenStack Client interface. Handles the REST calls and responses."""
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
|
@ -429,7 +427,7 @@ class HTTPClient(object):
|
|||
url = self.management_url + url
|
||||
resp, body = self.request(url, method, **kwargs)
|
||||
return resp, body
|
||||
except exceptions.BadRequest as e:
|
||||
except exceptions.BadRequest:
|
||||
if attempts > self.retries:
|
||||
raise
|
||||
except exceptions.Unauthorized:
|
||||
|
|
|
@ -118,10 +118,10 @@ class ShellTest(utils.TestCase):
|
|||
def test_help(self):
|
||||
# Some expected help output, including microversioned commands
|
||||
required = [
|
||||
'.*?^usage: ',
|
||||
'.*?(?m)^\s+create\s+Creates a volume.',
|
||||
'.*?(?m)^\s+summary\s+Get volumes summary.',
|
||||
'.*?(?m)^Run "cinder help SUBCOMMAND" for help on a subcommand.',
|
||||
r'.*?^usage: ',
|
||||
r'.*?(?m)^\s+create\s+Creates a volume.',
|
||||
r'.*?(?m)^\s+summary\s+Get volumes summary.',
|
||||
r'.*?(?m)^Run "cinder help SUBCOMMAND" for help on a subcommand.',
|
||||
]
|
||||
help_text = self.shell('help')
|
||||
for r in required:
|
||||
|
@ -130,8 +130,8 @@ class ShellTest(utils.TestCase):
|
|||
|
||||
def test_help_on_subcommand(self):
|
||||
required = [
|
||||
'.*?^usage: cinder list',
|
||||
'.*?(?m)^Lists all volumes.',
|
||||
r'.*?^usage: cinder list',
|
||||
r'.*?(?m)^Lists all volumes.',
|
||||
]
|
||||
help_text = self.shell('help list')
|
||||
for r in required:
|
||||
|
@ -140,8 +140,8 @@ class ShellTest(utils.TestCase):
|
|||
|
||||
def test_help_on_subcommand_mv(self):
|
||||
required = [
|
||||
'.*?^usage: cinder summary',
|
||||
'.*?(?m)^Get volumes summary.',
|
||||
r'.*?^usage: cinder summary',
|
||||
r'.*?(?m)^Get volumes summary.',
|
||||
]
|
||||
help_text = self.shell('help summary')
|
||||
for r in required:
|
||||
|
|
|
@ -33,22 +33,24 @@ def _get_default_RateLimit(verb="verb1", uri="uri1", regex="regex1",
|
|||
|
||||
class TestLimits(utils.TestCase):
|
||||
def test_repr(self):
|
||||
l = limits.Limits(None, {"foo": "bar"}, resp=REQUEST_ID)
|
||||
self.assertEqual("<Limits>", repr(l))
|
||||
self._assert_request_id(l)
|
||||
limit = limits.Limits(None, {"foo": "bar"}, resp=REQUEST_ID)
|
||||
self.assertEqual("<Limits>", repr(limit))
|
||||
self._assert_request_id(limit)
|
||||
|
||||
def test_absolute(self):
|
||||
l = limits.Limits(None,
|
||||
limit = limits.Limits(
|
||||
None,
|
||||
{"absolute": {"name1": "value1", "name2": "value2"}},
|
||||
resp=REQUEST_ID)
|
||||
l1 = limits.AbsoluteLimit("name1", "value1")
|
||||
l2 = limits.AbsoluteLimit("name2", "value2")
|
||||
for item in l.absolute:
|
||||
for item in limit.absolute:
|
||||
self.assertIn(item, [l1, l2])
|
||||
self._assert_request_id(l)
|
||||
self._assert_request_id(limit)
|
||||
|
||||
def test_rate(self):
|
||||
l = limits.Limits(None,
|
||||
limit = limits.Limits(
|
||||
None,
|
||||
{
|
||||
"rate": [
|
||||
{
|
||||
|
@ -76,17 +78,16 @@ class TestLimits(utils.TestCase):
|
|||
"next-available": "next2",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
}, ],
|
||||
},
|
||||
resp=REQUEST_ID)
|
||||
l1 = limits.RateLimit("verb1", "uri1", "regex1", "value1", "remain1",
|
||||
"unit1", "next1")
|
||||
l2 = limits.RateLimit("verb2", "uri2", "regex2", "value2", "remain2",
|
||||
"unit2", "next2")
|
||||
for item in l.rate:
|
||||
for item in limit.rate:
|
||||
self.assertIn(item, [l1, l2])
|
||||
self._assert_request_id(l)
|
||||
self._assert_request_id(limit)
|
||||
|
||||
|
||||
class TestRateLimit(utils.TestCase):
|
||||
|
|
|
@ -12,7 +12,7 @@ fasteners==0.7.0
|
|||
fixtures==3.0.0
|
||||
flake8==2.5.5
|
||||
future==0.16.0
|
||||
hacking==0.12.0
|
||||
hacking==2.0.0
|
||||
idna==2.6
|
||||
iso8601==0.1.11
|
||||
jsonschema==2.6.0
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
# process, which may cause wedges in the gate later.
|
||||
# Hacking already pins down pep8, pyflakes and flake8
|
||||
|
||||
hacking>=1.1.0,<1.2.0 # Apache-2.0
|
||||
hacking>=2.0.0 # Apache-2.0
|
||||
coverage!=4.4,>=4.0 # Apache-2.0
|
||||
ddt>=1.0.1 # MIT
|
||||
fixtures>=3.0.0 # Apache-2.0/BSD
|
||||
|
|
|
@ -71,5 +71,6 @@ def main(argv):
|
|||
install.install_dependencies()
|
||||
print_help(project, venv, root)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main(sys.argv)
|
||||
|
|
Loading…
Reference in New Issue