Sync with openstack/requirements master branch

In order to accept the requirements contract defined in
openstack/requirements, we need to sync with the master branch of that
project's global-requirements.txt and test-requirements.txt files.

Most of the changes are just version changes and nothing major.  The
only major changes are:

1) Removing httpretty and therefore needing to update the test_shell.py
file which uses httpretty.  It seems like the code that was dependent on
httpretty is not even being ran as part of the UTs, so this code was
removed.

2) The twine dependency is removed, and therefore the pypi tox
environment was also removed.

Change-Id: I939856e9b0a32792bea45b42c489dc9bbbe62782
Closes-Bug: #1533283
This commit is contained in:
Taylor Peoples 2016-01-18 22:50:07 +01:00
parent 59c0dc667e
commit b30fad9965
4 changed files with 5 additions and 164 deletions

View File

@ -3,8 +3,8 @@
# process, which may cause wedges in the gate later.
Babel>=1.3
oslo.i18n>=1.5.0 # Apache-2.0
oslo.utils>=2.0.0,!=2.6.0 # Apache-2.0
oslo.i18n>=2.1.0 # Apache-2.0
oslo.utils>=3.4.0 # Apache-2.0
pbr>=1.6
python-keystoneclient>=1.6.0,!=1.8.0
python-keystoneclient>=1.6.0,!=1.8.0,!=2.1.0
six>=1.9.0

View File

@ -4,10 +4,9 @@
coverage>=3.6
discover
hacking<0.11,>=0.10
httpretty>=0.8.4,<0.8.7
hacking>=0.10.2,<0.11
mock>=1.2
oslosphinx>=2.5.0 # Apache-2.0
oslosphinx>=2.5.0,!=3.4.0 # Apache-2.0
oslotest>=1.10.0 # Apache-2.0
python-subunit>=0.0.18
sphinx>=1.1.2,!=1.2.0,!=1.3b1,<1.3
@ -17,4 +16,3 @@ testtools>=1.4.0
# Needed for pypi packaging
wheel
twine

View File

@ -34,11 +34,6 @@ ignore = E123,E125
builtins = _
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build
[testenv:pypi]
commands =
python setup.py sdist bdist_wheel
twine upload --config-file .pypirc {posargs} dist/*
[testenv:wheel]
commands = python setup.py bdist_wheel

View File

@ -12,24 +12,17 @@
# License for the specific language governing permissions and limitations
# under the License.
import json
import os
import re
import sys
import fixtures
import httpretty
from keystoneclient import exceptions as keystone_exc
from keystoneclient.fixture import v2 as ks_v2_fixture
from keystoneclient.fixture import v3 as ks_v3_fixture
import mock
import six
import testtools
from testtools import matchers
from watcherclient import exceptions as exc
from watcherclient import shell as watcher_shell
from watcherclient.tests import keystone_client_fixtures
from watcherclient.tests import utils
FAKE_ENV = {'OS_USERNAME': 'username',
@ -37,22 +30,6 @@ FAKE_ENV = {'OS_USERNAME': 'username',
'OS_TENANT_NAME': 'tenant_name',
'OS_AUTH_URL': 'http://no.where/v2.0/'}
FAKE_ENV_KEYSTONE_V2 = {
'OS_USERNAME': 'username',
'OS_PASSWORD': 'password',
'OS_TENANT_NAME': 'tenant_name',
'OS_AUTH_URL': keystone_client_fixtures.BASE_URL,
}
FAKE_ENV_KEYSTONE_V3 = {
'OS_USERNAME': 'username',
'OS_PASSWORD': 'password',
'OS_TENANT_NAME': 'tenant_name',
'OS_AUTH_URL': keystone_client_fixtures.BASE_URL,
'OS_USER_DOMAIN_ID': 'default',
'OS_PROJECT_DOMAIN_ID': 'default',
}
class ShellTest(utils.BaseTestCase):
re_options = re.DOTALL | re.MULTILINE
@ -175,132 +152,3 @@ class ShellTest(utils.BaseTestCase):
for r in required:
self.assertThat(stdout,
matchers.MatchesRegex(r, self.re_options))
class TestCase(testtools.TestCase):
tokenid = keystone_client_fixtures.TOKENID
def set_fake_env(self, fake_env):
client_env = ('OS_USERNAME', 'OS_PASSWORD', 'OS_TENANT_ID',
'OS_TENANT_NAME', 'OS_AUTH_URL', 'OS_REGION_NAME',
'OS_AUTH_TOKEN', 'OS_NO_CLIENT_AUTH', 'OS_SERVICE_TYPE',
'OS_ENDPOINT_TYPE')
for key in client_env:
self.useFixture(
fixtures.EnvironmentVariable(key, fake_env.get(key)))
# required for testing with Python 2.6
def assertRegexpMatches(self, text, expected_regexp, msg=None):
"""Fail the test unless the text matches the regular expression."""
if isinstance(expected_regexp, six.string_types):
expected_regexp = re.compile(expected_regexp)
if not expected_regexp.search(text):
msg = msg or "Regexp didn't match"
msg = '%s: %r not found in %r' % (
msg, expected_regexp.pattern, text)
raise self.failureException(msg)
def register_keystone_v2_token_fixture(self):
v2_token = ks_v2_fixture.Token(token_id=self.tokenid)
service = v2_token.add_service('baremetal')
service.add_endpoint('http://watcher.example.com', region='RegionOne')
httpretty.register_uri(
httpretty.POST,
'%s/tokens' % (keystone_client_fixtures.V2_URL),
body=json.dumps(v2_token))
def register_keystone_v3_token_fixture(self):
v3_token = ks_v3_fixture.Token()
service = v3_token.add_service('baremetal')
service.add_standard_endpoints(public='http://watcher.example.com')
httpretty.register_uri(
httpretty.POST,
'%s/auth/tokens' % (keystone_client_fixtures.V3_URL),
body=json.dumps(v3_token),
adding_headers={'X-Subject-Token': self.tokenid})
def register_keystone_auth_fixture(self):
self.register_keystone_v2_token_fixture()
self.register_keystone_v3_token_fixture()
httpretty.register_uri(
httpretty.GET,
keystone_client_fixtures.BASE_URL,
body=keystone_client_fixtures.keystone_request_callback)
class ShellTestNoMox(TestCase):
def setUp(self):
super(ShellTestNoMox, self).setUp()
# httpretty doesn't work as expected if http proxy environment
# variable is set.
os.environ = dict((k, v) for (k, v) in os.environ.items()
if k.lower() not in ('http_proxy', 'https_proxy'))
self.set_fake_env(FAKE_ENV_KEYSTONE_V2)
def shell(self, argstr):
orig = sys.stdout
try:
sys.stdout = six.StringIO()
_shell = watcher_shell.WatcherShell()
_shell.main(argstr.split())
self.subcommands = _shell.subcommands.keys()
except SystemExit:
exc_type, exc_value, exc_traceback = sys.exc_info()
self.assertEqual(0, exc_value.code)
finally:
out = sys.stdout.getvalue()
sys.stdout.close()
sys.stdout = orig
return out
# @httpretty.activate
# def test_action_list(self):
# self.register_keystone_auth_fixture()
# resp_dict = {"dummies": [
# {"instance_uuid": "null",
# "uuid": "351a82d6-9f04-4c36-b79a-a38b9e98ff71",
# "links": [{"href": "http://watcher.example.com:6385/"
# "v1/dummies/foo",
# "rel": "self"},
# {"href": "http://watcher.example.com:6385/"
# "dummies/foo",
# "rel": "bookmark"}],
# "maintenance": "false",
# "provision_state": "null",
# "power_state": "power off"},
# {"instance_uuid": "null",
# "uuid": "66fbba13-29e8-4b8a-9e80-c655096a40d3",
# "links": [{"href": "http://watcher.example.com:6385/"
# "v1/dummies/foo2",
# "rel": "self"},
# {"href": "http://watcher.example.com:6385/"
# "dummies/foo2",
# "rel": "bookmark"}],
# "maintenance": "false",
# "provision_state": "null",
# "power_state": "power off"}]}
# httpretty.register_uri(
# httpretty.GET,
# 'http://watcher.example.com/v1/dummies',
# status=200,
# content_type='application/json; charset=UTF-8',
# body=json.dumps(resp_dict))
# event_list_text = self.shell('action-list')
# required = [
# '351a82d6-9f04-4c36-b79a-a38b9e98ff71',
# '66fbba13-29e8-4b8a-9e80-c655096a40d3',
# ]
# for r in required:
# self.assertRegexpMatches(event_list_text, r)
class ShellTestNoMoxV3(ShellTestNoMox):
def _set_fake_env(self):
self.set_fake_env(FAKE_ENV_KEYSTONE_V3)