def test_get_logfile_to_local(self):
    self.patch('zaza.utilities.installers.user_directory', name='mock_user_directory')
    self.mock_user_directory.return_value = '/some/dir'
    mock_scp_fn = mock.Mock()
    self.c._scp_fn = mock_scp_fn
    with mock.patch.object(conncheck.ConnCheckInstanceBase, 'local_log_filename', new_callable=mock.PropertyMock) as mock_local_log_filename:
        mock_local_log_filename.return_value = 'some-filename'
        self.assertEqual(self.c.get_logfile_to_local('/a/dir'), '/a/dir/some-filename')
    mock_scp_fn.assert_called_once_with('/some/dir/conncheck.log', '/a/dir/some-filename', copy_from=True)
def test_get_logfile_to_local(self):
    self.patch('zaza.utilities.installers.user_directory', name='mock_user_directory')
    self.mock_user_directory.return_value = '/some/dir'
    mock_scp_fn = mock.Mock()
    self.c._scp_fn = mock_scp_fn
    with mock.patch.object(conncheck.ConnCheckInstanceBase, 'local_log_filename', new_callable=mock.PropertyMock) as mock_local_log_filename:
        mock_local_log_filename.return_value = 'some-filename'
        self.assertEqual(self.c.get_logfile_to_local('/a/dir'), '/a/dir/some-filename')
    mock_scp_fn.assert_called_once_with('/some/dir/conncheck.log', '/a/dir/some-filename', copy_from=True)