Remove unnecessary unicode prefixes

Change-Id: I87ee686a86be738ee96edf647a33fc3ce0510853
This commit is contained in:
Hervé Beraud 2022-04-20 12:57:34 +02:00 committed by Douglas Mendizábal
parent 57fb686b20
commit b73046ff74
10 changed files with 33 additions and 33 deletions

View File

@ -45,13 +45,13 @@ source_suffix = '.rst'
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = u'Key Manager API Guide'
openstackdocs_bug_tag = u'api-guide'
project = 'Key Manager API Guide'
openstackdocs_bug_tag = 'api-guide'
openstackdocs_repo_name = 'openstack/barbican'
openstackdocs_auto_name = False
openstackdocs_bug_project = 'barbican'
copyright = u'2016, OpenStack contributors'
copyright = '2016, OpenStack contributors'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
@ -190,8 +190,8 @@ latex_elements = {
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
('index', 'KeyManagerAPI.tex', u'Key Manager API Documentation',
u'OpenStack contributors', 'manual'),
('index', 'KeyManagerAPI.tex', 'Key Manager API Documentation',
'OpenStack contributors', 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
@ -220,8 +220,8 @@ latex_documents = [
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'keymanagerapi', u'Key Manager API Documentation',
[u'OpenStack contributors'], 1)
('index', 'keymanagerapi', 'Key Manager API Documentation',
['OpenStack contributors'], 1)
]
# If true, show URL addresses after external links.
@ -234,8 +234,8 @@ man_pages = [
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
('index', 'KeyManagerAPIGuide', u'Key Manager API Guide',
u'OpenStack contributors', 'APIGuide',
('index', 'KeyManagerAPIGuide', 'Key Manager API Guide',
'OpenStack contributors', 'APIGuide',
'This guide teaches OpenStack Key Manager service users concepts about '
'managing keys in an OpenStack cloud with the Key Manager API.',
'Miscellaneous'),
@ -259,6 +259,6 @@ locale_dirs = ['locale/']
# -- Options for PDF output --------------------------------------------------
pdf_documents = [
('index', u'KeyManagerAPIGuide', u'Key Manager API Guide', u'OpenStack '
('index', 'KeyManagerAPIGuide', 'Key Manager API Guide', 'OpenStack '
'contributors')
]

View File

@ -130,7 +130,7 @@ class NotificationTask(object):
"""Gets project resource identifier from payload
Sample payload is provided below::
{'resource_info': u'2b99a94ad02741978e613fb52dd1f4cd'}
{'resource_info': '2b99a94ad02741978e613fb52dd1f4cd'}
"""
if payload_s:
return payload_s.get('resource_info')

View File

@ -150,8 +150,8 @@ class WhenGettingTransKeysListUsingTransportKeysResource(FunctionalTest):
self.repo.get_by_create_date.assert_called_once_with(
plugin_name=None,
offset_arg=u'{0}'.format(self.offset),
limit_arg=u'{0}'.format(self.limit),
offset_arg='{0}'.format(self.offset),
limit_arg='{0}'.format(self.limit),
suppress_exception=True
)
@ -185,8 +185,8 @@ class WhenGettingTransKeysListUsingTransportKeysResource(FunctionalTest):
self.repo.get_by_create_date.assert_called_once_with(
plugin_name=None,
offset_arg=u'{0}'.format(self.offset),
limit_arg=u'{0}'.format(self.limit),
offset_arg='{0}'.format(self.offset),
limit_arg='{0}'.format(self.limit),
suppress_exception=True
)

View File

@ -84,7 +84,7 @@ class WhenTestingQuotaDriverFunctions(database_utils.RepositoryTestCase):
self.create_a_test_project_quotas()
project_quotas = self.quota_driver.get_project_quotas_list()
self.assertEqual({'project_quotas': [{
'project_id': u'project1',
'project_id': 'project1',
'project_quotas': {'consumers': 105,
'containers': 103,
'orders': 102,

View File

@ -103,9 +103,9 @@ class WhenTestingValidatorsFunctions(utils.BaseTestCase):
self.assertTrue(is_too_big)
def test_secret_too_big_is_true_for_big_unicode_secrets(self):
beer = u'\U0001F37A'
beer = '\U0001F37A'
data = beer * (validators.CONF.max_allowed_secret_in_bytes // 4)
data += u'1'
data += '1'
is_too_big = validators.secret_too_big(data)

View File

@ -47,7 +47,7 @@ class WhenTestingOrderRetryTaskRepository(database_utils.RepositoryTestCase):
self.assertEqual(order_retry_task.id, order_retry_task_from_get.id)
self.assertEqual(
self.date_time_now, order_retry_task_from_get.retry_at)
self.assertEqual(u'retry-task', order_retry_task_from_get.retry_task)
self.assertEqual('retry-task', order_retry_task_from_get.retry_task)
self.assertEqual(self.test_args, order_retry_task_from_get.retry_args)
self.assertEqual(self.test_kwargs,
order_retry_task_from_get.retry_kwargs)
@ -88,7 +88,7 @@ class WhenTestingOrderRetryTaskRepository(database_utils.RepositoryTestCase):
order_retry_task_from_get = entities[0]
self.assertEqual(order_retry_task.id, order_retry_task_from_get.id)
self.assertEqual(date_time_future, order_retry_task_from_get.retry_at)
self.assertEqual(u'retry-task', order_retry_task_from_get.retry_task)
self.assertEqual('retry-task', order_retry_task_from_get.retry_task)
self.assertEqual(self.test_args, order_retry_task_from_get.retry_args)
self.assertEqual(self.test_kwargs,
order_retry_task_from_get.retry_kwargs)
@ -120,7 +120,7 @@ class WhenTestingOrderRetryTaskRepository(database_utils.RepositoryTestCase):
order_retry_task = models.OrderRetryTask()
order_retry_task.order_id = order.id
order_retry_task.retry_task = u'retry-task'
order_retry_task.retry_task = 'retry-task'
order_retry_task.retry_at = retry_at or self.date_time_now
order_retry_task.retry_args = self.test_args
order_retry_task.retry_kwargs = self.test_kwargs

View File

@ -42,7 +42,7 @@ class WhenTestingSimpleCryptoPlugin(utils.BaseTestCase):
return self.plugin.bind_kek_metadata(kek_meta_dto)
def test_encrypt_unicode_raises_value_error(self):
unencrypted = u'unicode_beer\U0001F37A'
unencrypted = 'unicode_beer\U0001F37A'
encrypt_dto = plugin.EncryptDTO(unencrypted)
secret = mock.MagicMock()
secret.mime_type = 'text/plain'

View File

@ -474,7 +474,7 @@ class WhenTestingPKCS11(utils.BaseTestCase):
self.pkcs11._check_error, 0xe0)
def test_converting_unicode_to_bytes(self):
self.assertEqual(b'foo', pkcs11._to_bytes(u'foo'))
self.assertEqual(b'foo', pkcs11._to_bytes('foo'))
def test_converting_default_str_type_to_bytes(self):
self.assertEqual(b'foo', pkcs11._to_bytes('foo'))

View File

@ -68,7 +68,7 @@ Verify operation of the Key Manager (barbican) service.
| Name | mysecret |
| Created | 2016-08-16 16:04:10+00:00 |
| Status | ACTIVE |
| Content types | {u'default': u'application/octet-stream'} |
| Content types | {'default': 'application/octet-stream'} |
| Algorithm | aes |
| Bit length | 256 |
| Secret type | opaque |

View File

@ -465,7 +465,7 @@ class SecretsTestCase(base.TestCase):
Launchpad bug #1315498
"""
data = u'\U0001F37A'
data = '\U0001F37A'
data = data.encode('utf-8')
test_model = secret_models.SecretModel(
**self.default_secret_create_two_phase_data)
@ -1034,16 +1034,16 @@ class SecretsTestCase(base.TestCase):
@utils.parameterized_dataset({
'invalid_http_content_type_characaters_latin': {
'http_content_type': u'\u00c4'.encode('utf-8')},
'http_content_type': '\u00c4'.encode('utf-8')},
'invalid_http_content_type_characaters_arabic': {
'http_content_type': u'\u060f'.encode('utf-8')},
'http_content_type': '\u060f'.encode('utf-8')},
'invalid_http_content_type_characaters_cyrillic': {
'http_content_type': u'\u0416'.encode('utf-8')},
'http_content_type': '\u0416'.encode('utf-8')},
'invalid_http_content_type_characaters_replacement_character': {
'http_content_type': u'\ufffd'.encode('utf-8')},
'http_content_type': '\ufffd'.encode('utf-8')},
})
@testcase.attr('negative')
def test_secret_create_with_invalid_http_content_type_characters(
@ -1062,16 +1062,16 @@ class SecretsTestCase(base.TestCase):
@utils.parameterized_dataset({
'invalid_http_content_type_characaters_latin': {
'payload_content_type': u'\u00c4'.encode('utf-8')},
'payload_content_type': '\u00c4'.encode('utf-8')},
'invalid_http_content_type_characaters_arabic': {
'payload_content_type': u'\u060f'.encode('utf-8')},
'payload_content_type': '\u060f'.encode('utf-8')},
'invalid_http_content_type_characaters_cyrillic': {
'payload_content_type': u'\u0416'.encode('utf-8')},
'payload_content_type': '\u0416'.encode('utf-8')},
'invalid_http_content_type_characaters_replacement_character': {
'payload_content_type': u'\ufffd'.encode('utf-8')},
'payload_content_type': '\ufffd'.encode('utf-8')},
})
@testcase.attr('negative')
def test_secret_create_with_invalid_payload_content_type_characters(