Merge "Fix PEP8 E126 and E202 errors"

This commit is contained in:
Jenkins 2014-06-27 21:41:34 +00:00 committed by Gerrit Code Review
commit ddf0c16a10
4 changed files with 359 additions and 319 deletions

View File

@ -32,30 +32,33 @@ class TestConsumerCreate(TestOAuth1):
super(TestConsumerCreate, self).setUp() super(TestConsumerCreate, self).setUp()
self.consumers_mock.create.return_value = fakes.FakeResource( self.consumers_mock.create.return_value = fakes.FakeResource(
None, copy.deepcopy(identity_fakes.OAUTH_CONSUMER), None,
loaded=True) copy.deepcopy(identity_fakes.OAUTH_CONSUMER),
loaded=True,
)
self.cmd = consumer.CreateConsumer(self.app, None) self.cmd = consumer.CreateConsumer(self.app, None)
def test_create_consumer(self): def test_create_consumer(self):
arglist = [ arglist = [
'--description', identity_fakes.consumer_description '--description', identity_fakes.consumer_description,
] ]
verifylist = [ verifylist = [
('description', identity_fakes.consumer_description) ('description', identity_fakes.consumer_description),
] ]
parsed_args = self.check_parser(self.cmd, arglist, verifylist) parsed_args = self.check_parser(self.cmd, arglist, verifylist)
columns, data = self.cmd.take_action(parsed_args) columns, data = self.cmd.take_action(parsed_args)
self.consumers_mock.create.assert_called_with( self.consumers_mock.create.assert_called_with(
identity_fakes.consumer_description) identity_fakes.consumer_description,
)
collist = ('description', 'id', 'secret') collist = ('description', 'id', 'secret')
self.assertEqual(columns, collist) self.assertEqual(columns, collist)
datalist = ( datalist = (
identity_fakes.consumer_description, identity_fakes.consumer_description,
identity_fakes.consumer_id, identity_fakes.consumer_id,
identity_fakes.consumer_secret identity_fakes.consumer_secret,
) )
self.assertEqual(data, datalist) self.assertEqual(data, datalist)
@ -69,17 +72,18 @@ class TestConsumerDelete(TestOAuth1):
self.consumers_mock.get.return_value = fakes.FakeResource( self.consumers_mock.get.return_value = fakes.FakeResource(
None, None,
copy.deepcopy(identity_fakes.OAUTH_CONSUMER), copy.deepcopy(identity_fakes.OAUTH_CONSUMER),
loaded=True) loaded=True,
)
self.consumers_mock.delete.return_value = None self.consumers_mock.delete.return_value = None
self.cmd = consumer.DeleteConsumer(self.app, None) self.cmd = consumer.DeleteConsumer(self.app, None)
def test_delete_consumer(self): def test_delete_consumer(self):
arglist = [ arglist = [
identity_fakes.consumer_id identity_fakes.consumer_id,
] ]
verifylist = [ verifylist = [
('consumer', identity_fakes.consumer_id) ('consumer', identity_fakes.consumer_id),
] ]
parsed_args = self.check_parser(self.cmd, arglist, verifylist) parsed_args = self.check_parser(self.cmd, arglist, verifylist)
@ -125,7 +129,7 @@ class TestConsumerList(TestOAuth1):
self.assertEqual(columns, collist) self.assertEqual(columns, collist)
datalist = (( datalist = ((
identity_fakes.consumer_id, identity_fakes.consumer_id,
identity_fakes.consumer_description identity_fakes.consumer_description,
), ) ), )
self.assertEqual(tuple(data), datalist) self.assertEqual(tuple(data), datalist)
@ -138,29 +142,33 @@ class TestConsumerShow(TestOAuth1):
consumer_no_secret = copy.deepcopy(identity_fakes.OAUTH_CONSUMER) consumer_no_secret = copy.deepcopy(identity_fakes.OAUTH_CONSUMER)
del consumer_no_secret['secret'] del consumer_no_secret['secret']
self.consumers_mock.get.return_value = fakes.FakeResource( self.consumers_mock.get.return_value = fakes.FakeResource(
None, consumer_no_secret, loaded=True) None,
consumer_no_secret,
loaded=True,
)
# Get the command object to test # Get the command object to test
self.cmd = consumer.ShowConsumer(self.app, None) self.cmd = consumer.ShowConsumer(self.app, None)
def test_consumer_show(self): def test_consumer_show(self):
arglist = [ arglist = [
identity_fakes.consumer_id identity_fakes.consumer_id,
] ]
verifylist = [ verifylist = [
('consumer', identity_fakes.consumer_id) ('consumer', identity_fakes.consumer_id),
] ]
parsed_args = self.check_parser(self.cmd, arglist, verifylist) parsed_args = self.check_parser(self.cmd, arglist, verifylist)
columns, data = self.cmd.take_action(parsed_args) columns, data = self.cmd.take_action(parsed_args)
self.consumers_mock.get.assert_called_with( self.consumers_mock.get.assert_called_with(
identity_fakes.consumer_id) identity_fakes.consumer_id,
)
collist = ('description', 'id') collist = ('description', 'id')
self.assertEqual(columns, collist) self.assertEqual(columns, collist)
datalist = ( datalist = (
identity_fakes.consumer_description, identity_fakes.consumer_description,
identity_fakes.consumer_id identity_fakes.consumer_id,
) )
self.assertEqual(data, datalist) self.assertEqual(data, datalist)
@ -171,12 +179,18 @@ class TestConsumerSet(TestOAuth1):
super(TestConsumerSet, self).setUp() super(TestConsumerSet, self).setUp()
self.consumers_mock.get.return_value = fakes.FakeResource( self.consumers_mock.get.return_value = fakes.FakeResource(
None, copy.deepcopy(identity_fakes.OAUTH_CONSUMER), loaded=True) None,
copy.deepcopy(identity_fakes.OAUTH_CONSUMER),
loaded=True,
)
consumer_updated = copy.deepcopy(identity_fakes.OAUTH_CONSUMER) consumer_updated = copy.deepcopy(identity_fakes.OAUTH_CONSUMER)
consumer_updated['description'] = "consumer new description" consumer_updated['description'] = "consumer new description"
self.consumers_mock.update.return_value = fakes.FakeResource( self.consumers_mock.update.return_value = fakes.FakeResource(
None, consumer_updated, loaded=True) None,
consumer_updated,
loaded=True,
)
self.cmd = consumer.SetConsumer(self.app, None) self.cmd = consumer.SetConsumer(self.app, None)
@ -185,11 +199,11 @@ class TestConsumerSet(TestOAuth1):
arglist = [ arglist = [
'--description', new_description, '--description', new_description,
identity_fakes.consumer_id identity_fakes.consumer_id,
] ]
verifylist = [ verifylist = [
('description', new_description), ('description', new_description),
('consumer', identity_fakes.consumer_id) ('consumer', identity_fakes.consumer_id),
] ]
parsed_args = self.check_parser(self.cmd, arglist, verifylist) parsed_args = self.check_parser(self.cmd, arglist, verifylist)
result = self.cmd.run(parsed_args) result = self.cmd.run(parsed_args)
@ -197,4 +211,6 @@ class TestConsumerSet(TestOAuth1):
kwargs = {'description': new_description} kwargs = {'description': new_description}
self.consumers_mock.update.assert_called_with( self.consumers_mock.update.assert_called_with(
identity_fakes.consumer_id, **kwargs) identity_fakes.consumer_id,
**kwargs
)

View File

@ -39,18 +39,20 @@ class TestIdentityProviderCreate(TestIdentityProvider):
fakes.FakeResource( fakes.FakeResource(
None, None,
copy.deepcopy(identity_fakes.IDENTITY_PROVIDER), copy.deepcopy(identity_fakes.IDENTITY_PROVIDER),
loaded=True loaded=True,
) )
self.cmd = identity_provider.CreateIdentityProvider( self.cmd = identity_provider.CreateIdentityProvider(
self.app, None) self.app,
None,
)
def test_create_identity_provider_no_options(self): def test_create_identity_provider_no_options(self):
arglist = [ arglist = [
identity_fakes.idp_id identity_fakes.idp_id,
] ]
verifylist = [ verifylist = [
('identity_provider_id', identity_fakes.idp_id) ('identity_provider_id', identity_fakes.idp_id),
] ]
parsed_args = self.check_parser(self.cmd, arglist, verifylist) parsed_args = self.check_parser(self.cmd, arglist, verifylist)
columns, data = self.cmd.take_action(parsed_args) columns, data = self.cmd.take_action(parsed_args)
@ -62,7 +64,9 @@ class TestIdentityProviderCreate(TestIdentityProvider):
} }
self.identity_providers_mock.create.assert_called_with( self.identity_providers_mock.create.assert_called_with(
identity_fakes.idp_id, **kwargs) identity_fakes.idp_id,
**kwargs
)
collist = ('description', 'enabled', 'id') collist = ('description', 'enabled', 'id')
self.assertEqual(columns, collist) self.assertEqual(columns, collist)
@ -74,11 +78,13 @@ class TestIdentityProviderCreate(TestIdentityProvider):
self.assertEqual(data, datalist) self.assertEqual(data, datalist)
def test_create_identity_provider_description(self): def test_create_identity_provider_description(self):
arglist = ['--description', identity_fakes.idp_description, arglist = [
identity_fakes.idp_id] '--description', identity_fakes.idp_description,
identity_fakes.idp_id,
]
verifylist = [ verifylist = [
('identity_provider_id', identity_fakes.idp_id), ('identity_provider_id', identity_fakes.idp_id),
('description', identity_fakes.idp_description) ('description', identity_fakes.idp_description),
] ]
parsed_args = self.check_parser(self.cmd, arglist, verifylist) parsed_args = self.check_parser(self.cmd, arglist, verifylist)
columns, data = self.cmd.take_action(parsed_args) columns, data = self.cmd.take_action(parsed_args)
@ -90,12 +96,16 @@ class TestIdentityProviderCreate(TestIdentityProvider):
} }
self.identity_providers_mock.create.assert_called_with( self.identity_providers_mock.create.assert_called_with(
identity_fakes.idp_id, **kwargs) identity_fakes.idp_id,
**kwargs
)
collist = ('description', 'enabled', 'id') collist = ('description', 'enabled', 'id')
self.assertEqual(columns, collist) self.assertEqual(columns, collist)
datalist = ( datalist = (
identity_fakes.idp_description, True, identity_fakes.idp_id, identity_fakes.idp_description,
True,
identity_fakes.idp_id,
) )
self.assertEqual(data, datalist) self.assertEqual(data, datalist)
@ -110,13 +120,14 @@ class TestIdentityProviderCreate(TestIdentityProvider):
fakes.FakeResource( fakes.FakeResource(
None, None,
IDENTITY_PROVIDER, IDENTITY_PROVIDER,
loaded=True loaded=True,
) )
arglist = ['--disable', arglist = [
identity_fakes.idp_id] '--disable',
identity_fakes.idp_id,
]
verifylist = [ verifylist = [
('identity_provider_id', identity_fakes.idp_id), ('identity_provider_id', identity_fakes.idp_id),
] ]
parsed_args = self.check_parser(self.cmd, arglist, verifylist) parsed_args = self.check_parser(self.cmd, arglist, verifylist)
columns, data = self.cmd.take_action(parsed_args) columns, data = self.cmd.take_action(parsed_args)
@ -124,11 +135,13 @@ class TestIdentityProviderCreate(TestIdentityProvider):
# Set expected values # Set expected values
kwargs = { kwargs = {
'enabled': False, 'enabled': False,
'description': None 'description': None,
} }
self.identity_providers_mock.create.assert_called_with( self.identity_providers_mock.create.assert_called_with(
identity_fakes.idp_id, **kwargs) identity_fakes.idp_id,
**kwargs
)
collist = ('description', 'enabled', 'id') collist = ('description', 'enabled', 'id')
self.assertEqual(columns, collist) self.assertEqual(columns, collist)
@ -149,18 +162,18 @@ class TestIdentityProviderDelete(TestIdentityProvider):
self.identity_providers_mock.get.return_value = fakes.FakeResource( self.identity_providers_mock.get.return_value = fakes.FakeResource(
None, None,
copy.deepcopy(identity_fakes.IDENTITY_PROVIDER), copy.deepcopy(identity_fakes.IDENTITY_PROVIDER),
loaded=True) loaded=True,
)
self.identity_providers_mock.delete.return_value = None self.identity_providers_mock.delete.return_value = None
self.cmd = identity_provider.DeleteIdentityProvider( self.cmd = identity_provider.DeleteIdentityProvider(self.app, None)
self.app, None)
def test_delete_identity_provider(self): def test_delete_identity_provider(self):
arglist = [ arglist = [
identity_fakes.idp_id identity_fakes.idp_id,
] ]
verifylist = [ verifylist = [
('identity_provider', identity_fakes.idp_id) ('identity_provider', identity_fakes.idp_id),
] ]
parsed_args = self.check_parser(self.cmd, arglist, verifylist) parsed_args = self.check_parser(self.cmd, arglist, verifylist)
self.cmd.take_action(parsed_args) self.cmd.take_action(parsed_args)
@ -205,8 +218,7 @@ class TestIdentityProviderList(TestIdentityProvider):
datalist = (( datalist = ((
identity_fakes.idp_id, identity_fakes.idp_id,
True, True,
identity_fakes.idp_description identity_fakes.idp_description,
), ) ), )
self.assertEqual(tuple(data), datalist) self.assertEqual(tuple(data), datalist)
@ -219,7 +231,7 @@ class TestIdentityProviderShow(TestIdentityProvider):
self.identity_providers_mock.get.return_value = fakes.FakeResource( self.identity_providers_mock.get.return_value = fakes.FakeResource(
None, None,
copy.deepcopy(identity_fakes.IDENTITY_PROVIDER), copy.deepcopy(identity_fakes.IDENTITY_PROVIDER),
loaded=True loaded=True,
) )
# Get the command object to test # Get the command object to test
@ -227,24 +239,25 @@ class TestIdentityProviderShow(TestIdentityProvider):
def test_identity_provider_show(self): def test_identity_provider_show(self):
arglist = [ arglist = [
identity_fakes.idp_id identity_fakes.idp_id,
] ]
verifylist = [ verifylist = [
('identity_provider', identity_fakes.idp_id) ('identity_provider', identity_fakes.idp_id),
] ]
parsed_args = self.check_parser(self.cmd, arglist, verifylist) parsed_args = self.check_parser(self.cmd, arglist, verifylist)
columns, data = self.cmd.take_action(parsed_args) columns, data = self.cmd.take_action(parsed_args)
self.identity_providers_mock.get.assert_called_with( self.identity_providers_mock.get.assert_called_with(
identity_fakes.idp_id) identity_fakes.idp_id,
)
collist = ('description', 'enabled', 'id') collist = ('description', 'enabled', 'id')
self.assertEqual(columns, collist) self.assertEqual(columns, collist)
datalist = ( datalist = (
identity_fakes.idp_description, identity_fakes.idp_description,
True, True,
identity_fakes.idp_id identity_fakes.idp_id,
) )
self.assertEqual(data, datalist) self.assertEqual(data, datalist)
@ -259,7 +272,6 @@ class TestIdentityProviderSet(TestIdentityProvider):
"""Disable Identity Provider """Disable Identity Provider
Set Identity Provider's ``enabled`` attribute to False. Set Identity Provider's ``enabled`` attribute to False.
""" """
def prepare(self): def prepare(self):
"""Prepare fake return objects before the test is executed""" """Prepare fake return objects before the test is executed"""
@ -274,23 +286,27 @@ class TestIdentityProviderSet(TestIdentityProvider):
prepare(self) prepare(self)
arglist = [ arglist = [
'--disable', identity_fakes.idp_id '--disable', identity_fakes.idp_id,
] ]
verifylist = [ verifylist = [
('identity_provider', identity_fakes.idp_id), ('identity_provider', identity_fakes.idp_id),
('enable', False), ('enable', False),
('disable', True) ('disable', True),
] ]
parsed_args = self.check_parser(self.cmd, arglist, verifylist) parsed_args = self.check_parser(self.cmd, arglist, verifylist)
columns, data = self.cmd.take_action(parsed_args) columns, data = self.cmd.take_action(parsed_args)
self.identity_providers_mock.update.assert_called_with( self.identity_providers_mock.update.assert_called_with(
identity_fakes.idp_id, enabled=False) identity_fakes.idp_id,
enabled=False,
)
collist = ('description', 'enabled', 'id') collist = ('description', 'enabled', 'id')
self.assertEqual(columns, collist) self.assertEqual(columns, collist)
datalist = ( datalist = (
identity_fakes.idp_description, identity_fakes.idp_description,
False, False,
identity_fakes.idp_id identity_fakes.idp_id,
) )
self.assertEqual(datalist, data) self.assertEqual(datalist, data)
@ -298,7 +314,6 @@ class TestIdentityProviderSet(TestIdentityProvider):
"""Enable Identity Provider. """Enable Identity Provider.
Set Identity Provider's ``enabled`` attribute to True. Set Identity Provider's ``enabled`` attribute to True.
""" """
def prepare(self): def prepare(self):
"""Prepare fake return objects before the test is executed""" """Prepare fake return objects before the test is executed"""
@ -311,12 +326,12 @@ class TestIdentityProviderSet(TestIdentityProvider):
prepare(self) prepare(self)
arglist = [ arglist = [
'--enable', identity_fakes.idp_id '--enable', identity_fakes.idp_id,
] ]
verifylist = [ verifylist = [
('identity_provider', identity_fakes.idp_id), ('identity_provider', identity_fakes.idp_id),
('enable', True), ('enable', True),
('disable', False) ('disable', False),
] ]
parsed_args = self.check_parser(self.cmd, arglist, verifylist) parsed_args = self.check_parser(self.cmd, arglist, verifylist)
@ -328,7 +343,7 @@ class TestIdentityProviderSet(TestIdentityProvider):
datalist = ( datalist = (
identity_fakes.idp_description, identity_fakes.idp_description,
True, True,
identity_fakes.idp_id identity_fakes.idp_id,
) )
self.assertEqual(data, datalist) self.assertEqual(data, datalist)
@ -345,18 +360,18 @@ class TestIdentityProviderSet(TestIdentityProvider):
resources = fakes.FakeResource( resources = fakes.FakeResource(
None, None,
copy.deepcopy(identity_fakes.IDENTITY_PROVIDER), copy.deepcopy(identity_fakes.IDENTITY_PROVIDER),
loaded=True loaded=True,
) )
self.identity_providers_mock.update.return_value = resources self.identity_providers_mock.update.return_value = resources
prepare(self) prepare(self)
arglist = [ arglist = [
identity_fakes.idp_id identity_fakes.idp_id,
] ]
verifylist = [ verifylist = [
('identity_provider', identity_fakes.idp_id), ('identity_provider', identity_fakes.idp_id),
('enable', False), ('enable', False),
('disable', False) ('disable', False),
] ]
parsed_args = self.check_parser(self.cmd, arglist, verifylist) parsed_args = self.check_parser(self.cmd, arglist, verifylist)

View File

@ -34,8 +34,10 @@ class TestRequestTokenCreate(TestOAuth1):
super(TestRequestTokenCreate, self).setUp() super(TestRequestTokenCreate, self).setUp()
self.request_tokens_mock.create.return_value = fakes.FakeResource( self.request_tokens_mock.create.return_value = fakes.FakeResource(
None, copy.deepcopy(identity_fakes.OAUTH_REQUEST_TOKEN), None,
loaded=True) copy.deepcopy(identity_fakes.OAUTH_REQUEST_TOKEN),
loaded=True,
)
self.cmd = token.CreateRequestToken(self.app, None) self.cmd = token.CreateRequestToken(self.app, None)
@ -43,12 +45,12 @@ class TestRequestTokenCreate(TestOAuth1):
arglist = [ arglist = [
'--consumer-key', identity_fakes.consumer_id, '--consumer-key', identity_fakes.consumer_id,
'--consumer-secret', identity_fakes.consumer_secret, '--consumer-secret', identity_fakes.consumer_secret,
'--project-id', identity_fakes.project_id '--project-id', identity_fakes.project_id,
] ]
verifylist = [ verifylist = [
('consumer_key', identity_fakes.consumer_id), ('consumer_key', identity_fakes.consumer_id),
('consumer_secret', identity_fakes.consumer_secret), ('consumer_secret', identity_fakes.consumer_secret),
('project_id', identity_fakes.project_id) ('project_id', identity_fakes.project_id),
] ]
parsed_args = self.check_parser(self.cmd, arglist, verifylist) parsed_args = self.check_parser(self.cmd, arglist, verifylist)
columns, data = self.cmd.take_action(parsed_args) columns, data = self.cmd.take_action(parsed_args)
@ -56,7 +58,8 @@ class TestRequestTokenCreate(TestOAuth1):
self.request_tokens_mock.create.assert_called_with( self.request_tokens_mock.create.assert_called_with(
identity_fakes.consumer_id, identity_fakes.consumer_id,
identity_fakes.consumer_secret, identity_fakes.consumer_secret,
identity_fakes.project_id) identity_fakes.project_id,
)
collist = ('expires', 'id', 'key', 'secret') collist = ('expires', 'id', 'key', 'secret')
self.assertEqual(columns, collist) self.assertEqual(columns, collist)
@ -64,7 +67,7 @@ class TestRequestTokenCreate(TestOAuth1):
identity_fakes.request_token_expires, identity_fakes.request_token_expires,
identity_fakes.request_token_id, identity_fakes.request_token_id,
identity_fakes.request_token_id, identity_fakes.request_token_id,
identity_fakes.request_token_secret identity_fakes.request_token_secret,
) )
self.assertEqual(data, datalist) self.assertEqual(data, datalist)
@ -76,26 +79,29 @@ class TestRequestTokenAuthorize(TestOAuth1):
self.request_tokens_mock.authorize.return_value = \ self.request_tokens_mock.authorize.return_value = \
fakes.FakeResource( fakes.FakeResource(
None, copy.deepcopy(identity_fakes.OAUTH_VERIFIER), None,
loaded=True) copy.deepcopy(identity_fakes.OAUTH_VERIFIER),
loaded=True,
)
self.cmd = token.AuthorizeRequestToken(self.app, None) self.cmd = token.AuthorizeRequestToken(self.app, None)
def test_authorize_request_tokens(self): def test_authorize_request_tokens(self):
arglist = [ arglist = [
'--request-key', identity_fakes.request_token_id, '--request-key', identity_fakes.request_token_id,
'--role-ids', identity_fakes.role_id '--role-ids', identity_fakes.role_id,
] ]
verifylist = [ verifylist = [
('request_key', identity_fakes.request_token_id), ('request_key', identity_fakes.request_token_id),
('role_ids', identity_fakes.role_id) ('role_ids', identity_fakes.role_id),
] ]
parsed_args = self.check_parser(self.cmd, arglist, verifylist) parsed_args = self.check_parser(self.cmd, arglist, verifylist)
columns, data = self.cmd.take_action(parsed_args) columns, data = self.cmd.take_action(parsed_args)
self.request_tokens_mock.authorize.assert_called_with( self.request_tokens_mock.authorize.assert_called_with(
identity_fakes.request_token_id, identity_fakes.request_token_id,
[identity_fakes.role_id]) [identity_fakes.role_id],
)
collist = ('oauth_verifier',) collist = ('oauth_verifier',)
self.assertEqual(columns, collist) self.assertEqual(columns, collist)
@ -111,8 +117,10 @@ class TestAccessTokenCreate(TestOAuth1):
super(TestAccessTokenCreate, self).setUp() super(TestAccessTokenCreate, self).setUp()
self.access_tokens_mock.create.return_value = fakes.FakeResource( self.access_tokens_mock.create.return_value = fakes.FakeResource(
None, copy.deepcopy(identity_fakes.OAUTH_ACCESS_TOKEN), None,
loaded=True) copy.deepcopy(identity_fakes.OAUTH_ACCESS_TOKEN),
loaded=True,
)
self.cmd = token.CreateAccessToken(self.app, None) self.cmd = token.CreateAccessToken(self.app, None)
@ -122,14 +130,14 @@ class TestAccessTokenCreate(TestOAuth1):
'--consumer-secret', identity_fakes.consumer_secret, '--consumer-secret', identity_fakes.consumer_secret,
'--request-key', identity_fakes.request_token_id, '--request-key', identity_fakes.request_token_id,
'--request-secret', identity_fakes.request_token_secret, '--request-secret', identity_fakes.request_token_secret,
'--verifier', identity_fakes.oauth_verifier_pin '--verifier', identity_fakes.oauth_verifier_pin,
] ]
verifylist = [ verifylist = [
('consumer_key', identity_fakes.consumer_id), ('consumer_key', identity_fakes.consumer_id),
('consumer_secret', identity_fakes.consumer_secret), ('consumer_secret', identity_fakes.consumer_secret),
('request_key', identity_fakes.request_token_id), ('request_key', identity_fakes.request_token_id),
('request_secret', identity_fakes.request_token_secret), ('request_secret', identity_fakes.request_token_secret),
('verifier', identity_fakes.oauth_verifier_pin) ('verifier', identity_fakes.oauth_verifier_pin),
] ]
parsed_args = self.check_parser(self.cmd, arglist, verifylist) parsed_args = self.check_parser(self.cmd, arglist, verifylist)
columns, data = self.cmd.take_action(parsed_args) columns, data = self.cmd.take_action(parsed_args)
@ -139,7 +147,8 @@ class TestAccessTokenCreate(TestOAuth1):
identity_fakes.consumer_secret, identity_fakes.consumer_secret,
identity_fakes.request_token_id, identity_fakes.request_token_id,
identity_fakes.request_token_secret, identity_fakes.request_token_secret,
identity_fakes.oauth_verifier_pin) identity_fakes.oauth_verifier_pin,
)
collist = ('expires', 'id', 'key', 'secret') collist = ('expires', 'id', 'key', 'secret')
self.assertEqual(columns, collist) self.assertEqual(columns, collist)
@ -147,6 +156,6 @@ class TestAccessTokenCreate(TestOAuth1):
identity_fakes.access_token_expires, identity_fakes.access_token_expires,
identity_fakes.access_token_id, identity_fakes.access_token_id,
identity_fakes.access_token_id, identity_fakes.access_token_id,
identity_fakes.access_token_secret identity_fakes.access_token_secret,
) )
self.assertEqual(data, datalist) self.assertEqual(data, datalist)

View File

@ -28,6 +28,6 @@ commands=
python setup.py build_sphinx python setup.py build_sphinx
[flake8] [flake8]
ignore = E126,E202,W602,H302,H402,H305,H307,H904 ignore = H302,H305,H307,H402,H904
show-source = True show-source = True
exclude = .venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build,tools exclude = .venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build,tools