示例#1
0
 def test_log_name(self, derived_from, expected, caplog, monkeypatch):
     """Test log_name."""
     caplog.set_level(logging.INFO, logger="runway")
     monkeypatch.setattr(DeployEnvironment, "name", "test")
     obj = DeployEnvironment()
     obj.name_derived_from = derived_from
     obj.log_name()
     assert caplog.messages == expected
 def test_log_name(
     self,
     derived_from: str,
     expected: List[str],
     caplog: LogCaptureFixture,
     mocker: MockerFixture,
 ) -> None:
     """Test log_name."""
     caplog.set_level(logging.INFO, logger="runway")
     mocker.patch.object(DeployEnvironment, "name", "test")
     obj = DeployEnvironment()
     obj.name_derived_from = derived_from
     obj.log_name()
     assert caplog.messages == expected