

@mock.patch('rally.plugins.workload.siege.get_instances')
@mock.patch('rally.plugins.workload.siege.generate_urls_list')
@mock.patch('rally.plugins.workload.siege.subprocess.check_output')
def test_run(self, mock_check_output, mock_generate_urls_list, mock_get_instances):
    mock_get_instances.return_value = [1, 2]
    mock_stdout.return_value = 'urls'
    mock_check_output.return_value = SIEGE_OUTPUT
    mock_write = mock.MagicMock()
    mock_stdout = mock.MagicMock(write=mock_write)
    real_stdout = sys.stdout
    sys.stdout = mock_stdout
    siege.run()
    expected = [mock.call('Transaction rate:141.46\n'), mock.call('Throughput:0.29\n')]
    sys.stdout = real_stdout
    self.assertEqual(expected, mock_write.mock_calls)

dataset/ETHPy150Open openstack/rally/tests/unit/plugins/workload/test_siege.py SiegeTestCase.test_run/VarMisuse@50/120 `mock_generate_urls_list`->`mock_stdout`