mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-02-04 07:51:50 +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:
parent
cf663c6e95
commit
32dd5f04c5
1 changed files with 6 additions and 6 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue