mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
uthelper: make str and repr generic in base class (#10985)
* uthelper: make str and repr generic in base class * Update tests/unit/plugins/modules/uthelper.py
This commit is contained in:
@@ -203,6 +203,12 @@ class TestCaseMock:
|
||||
def build_mock(cls, mock_specs):
|
||||
return cls(mock_specs)
|
||||
|
||||
def __str__(self):
|
||||
return f"<{self.__class__.__name__} specs={self.mock_specs}>"
|
||||
|
||||
def __repr__(self):
|
||||
return f"{self.__class__.__name__}({self.mock_specs})"
|
||||
|
||||
def __init__(self, mock_specs):
|
||||
self.mock_specs = mock_specs
|
||||
|
||||
@@ -219,12 +225,6 @@ class TestCaseMock:
|
||||
class RunCommandMock(TestCaseMock):
|
||||
name = "run_command"
|
||||
|
||||
def __str__(self):
|
||||
return "<RunCommandMock specs={specs}>".format(specs=self.mock_specs)
|
||||
|
||||
def __repr__(self):
|
||||
return "RunCommandMock({specs})".format(specs=self.mock_specs)
|
||||
|
||||
def fixtures(self):
|
||||
@pytest.fixture
|
||||
def patch_bin(mocker):
|
||||
|
||||
Reference in New Issue
Block a user