1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-05-03 08:52:55 +00:00

Cleanup: remove unicode prefix, remove explicit inheritance from object (#11015)

* Address UP025: remove unicode literals from strings.

* Address UP004: class inherits from 'object'.
This commit is contained in:
Felix Fontein 2025-10-30 20:17:10 +01:00 committed by GitHub
parent f61847b116
commit 0c5466de47
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
242 changed files with 329 additions and 331 deletions

View file

@ -16,7 +16,7 @@ class Failure(Exception):
return str(self.details)
class Session(object):
class Session:
def __init__(self, uri, transport=None, encoding=None, verbose=0,
allow_none=1, ignore_ssl=False):

View file

@ -14,7 +14,7 @@ from httmock import urlmatch # noqa
import gitlab
class FakeAnsibleModule(object):
class FakeAnsibleModule:
def __init__(self, module_params=None):
self.check_mode = False
self.params = module_params if module_params else {}

View file

@ -14,7 +14,7 @@ from .oneview_module_loader import ONEVIEW_MODULE_UTILS_PATH
from hpOneView.oneview_client import OneViewClient
class OneViewBaseTest(object):
class OneViewBaseTest:
@pytest.fixture(autouse=True)
def setUp(self, mock_ansible_module, mock_ov_client, request):
marker = request.node.get_marker('resource')
@ -88,7 +88,7 @@ class FactsParamsTest(OneViewBaseTest):
self.resource.get_all.assert_called_once_with()
class OneViewBaseTestCase(object):
class OneViewBaseTestCase:
mock_ov_client_from_json_file = None
testing_class = None
mock_ansible_module = None

View file

@ -12,7 +12,7 @@ from ansible_collections.community.general.plugins.modules import alerta_custome
from ansible_collections.community.internal_test_tools.tests.unit.plugins.modules.utils import AnsibleExitJson, AnsibleFailJson, ModuleTestCase, set_module_args
class MockedReponse(object):
class MockedReponse:
def __init__(self, data):
self.data = data

View file

@ -91,7 +91,7 @@ class TestCirconusAnnotation(ModuleTestCase):
'_last_modified': 1502236928,
'_last_modified_by': '/user/1000',
# use res['annotation']['category'].encode('latin1').decode('utf8')
'category': u'new cat\xc3\xa9gor\xc3\xbf',
'category': 'new cat\xc3\xa9gor\xc3\xbf',
'description': 'test description',
'rel_metrics': [],
'start': 1502236927,

View file

@ -21,7 +21,7 @@ def pass_function(*args, **kwargs):
pass
GITHUB_DATA = {"url": u'https://api.github.com/repos/ansible/ansible',
GITHUB_DATA = {"url": 'https://api.github.com/repos/ansible/ansible',
"response": b"""
{
"id": 3638964,

View file

@ -46,7 +46,7 @@ class PagerDutyAlertsTest(unittest.TestCase):
)
class Response(object):
class Response:
def read(self):
return '{"incidents":[{"id": "incident_id", "status": "triggered"}]}'

View file

@ -34,7 +34,7 @@ def patch_rhsm_repository(mocker):
return_value=0)
class Repos(object):
class Repos:
"""
Helper class to represent a list of repositories

View file

@ -13,7 +13,7 @@ import yaml
import pytest
class UTHelper(object):
class UTHelper:
TEST_SPEC_VALID_SECTIONS = ["anchors", "test_cases"]
@staticmethod