def test_get_log_reader(): mock_system_paasta_config = mock.Mock(autospec="paasta_tools.utils.SystemPaastaConfig") mock_system_paasta_config.get_log_reader.return_value = {"driver": "scribereader", "cluster_map": {}} with contextlib.nested( mock.patch("paasta_tools.cli.cmds.logs.load_system_paasta_config", autospec=True), mock.patch("paasta_tools.cli.cmds.logs.scribereader"), ) as (mock_load_system_paasta_config, mock_scribereader): mock_load_system_paasta_config.return_value = mock_system_paasta_config actual = logs.get_log_reader() assert isinstance(actual, logs.ScribeLogReader)
def test_get_log_reader(): mock_system_paasta_config = mock.Mock(autospec='paasta_tools.utils.SystemPaastaConfig') mock_system_paasta_config.get_log_reader.return_value = {'driver': 'scribereader', 'options': {'cluster_map': {}}} with contextlib.nested( mock.patch('paasta_tools.cli.cmds.logs.load_system_paasta_config', autospec=True), mock.patch('paasta_tools.cli.cmds.logs.scribereader'), ) as ( mock_load_system_paasta_config, mock_scribereader, ): mock_load_system_paasta_config.return_value = mock_system_paasta_config actual = logs.get_log_reader() assert isinstance(actual, logs.ScribeLogReader)
def test_get_log_reader(): mock_system_paasta_config = mock.Mock( autospec="paasta_tools.utils.SystemPaastaConfig" ) mock_system_paasta_config.get_log_reader.return_value = { "driver": "scribereader", "options": {"cluster_map": {}}, } with mock.patch( "paasta_tools.cli.cmds.logs.load_system_paasta_config", autospec=True ) as mock_load_system_paasta_config, mock.patch( "paasta_tools.cli.cmds.logs.scribereader", autospec=True ): mock_load_system_paasta_config.return_value = mock_system_paasta_config actual = logs.get_log_reader() assert isinstance(actual, logs.ScribeLogReader)