@mock.patch('certbot._internal.main.logger.warning')
@mock.patch('certbot._internal.storage.renewal_file_for_certname')
@mock.patch('certbot._internal.cert_manager.delete')
@mock.patch('certbot._internal.cert_manager.match_and_check_overlaps')
@mock.patch('certbot._internal.storage.full_archive_path')
@mock.patch('certbot._internal.cert_manager.cert_path_to_lineage')
@test_util.patch_get_utility()
def test_overlapping_archive_dirs(self, mock_get_utility, mock_cert_path_to_lineage, mock_archive, mock_match_and_check_overlaps, mock_delete, mock_renewal_file_for_certname, mock_warning):
    config = self.config
    config.cert_path = '/some/reasonable/path'
    config.certname = ''
    mock_cert_path_to_lineage.return_value = 'example.com'
    mock_match_and_check_overlaps.side_effect = errors.OverlappingMatchFound()
    self._call(config)
    mock_delete.assert_not_called()
    self.assertEqual(mock_warning.call_count, 1)
@mock.patch('certbot._internal.main.logger.warning')
@mock.patch('certbot._internal.storage.renewal_file_for_certname')
@mock.patch('certbot._internal.cert_manager.delete')
@mock.patch('certbot._internal.cert_manager.match_and_check_overlaps')
@mock.patch('certbot._internal.storage.full_archive_path')
@mock.patch('certbot._internal.cert_manager.cert_path_to_lineage')
@test_util.patch_get_utility()
def test_overlapping_archive_dirs(self, mock_get_utility, mock_cert_path_to_lineage, mock_archive, mock_match_and_check_overlaps, mock_delete, mock_renewal_file_for_certname, mock_warning):
    config = self.config
    config.cert_path = '/some/reasonable/path'
    config.certname = 
    mock_cert_path_to_lineage.return_value = 'example.com'
    mock_match_and_check_overlaps.side_effect = errors.OverlappingMatchFound()
    self._call(config)
    mock_delete.assert_not_called()
    self.assertEqual(mock_warning.call_count, 1)