
    Ng                         d Z ddlmZ ddlmZ ddlZddlmZmZm	Z	 ddl
mZ ddlmZmZmZ ddlmZ d	 Zd
 Zd Z G d d          ZdS )zTest suite for the `unstructured.chunking.basic` module.

That module implements the baseline chunking strategy. The baseline strategy has all behaviors
shared by all chunking strategies and no extra rules like perserve section or page boundaries.
    )annotations)AnyN)FixtureRequestMockfunction_mock)chunk_elements)CompositeElementTextTitle)partition_docxc                 T   d} t          | d          }|t          d          t          d          t          d          t          d          t          d          t          d	          t          d
          t          d          t          d          t          d          g
k    sJ dS )zKBasic chunking can be combined with partitioning, exercising the decorator.zexample-docs/handbook-1p.docxbasic)chunking_strategyuT   US Trustee Handbook

CHAPTER 1

INTRODUCTION

CHAPTER 1 – INTRODUCTION

A.	PURPOSEu  The United States Trustee appoints and supervises standing trustees and monitors and supervises cases under chapter 13 of title 11 of the United States Code.  28 U.S.C. § 586(b).  The Handbook, issued as part of our duties under 28 U.S.C. § 586, establishes or clarifies the position of the United States Trustee Program (Program) on the duties owed by a standing trustee to the debtors, creditors, other parties in interest, and the United States Trustee.  The Handbook does not present a full andu  complete statement of the law; it should not be used as a substitute for legal research and analysis.  The standing trustee must be familiar with relevant provisions of the Bankruptcy Code, Federal Rules of Bankruptcy Procedure (Rules), any local bankruptcy rules, and case law.  11 U.S.C. § 321, 28 U.S.C. § 586, 28 C.F.R. § 58.6(a)(3).  Standing trustees are encouraged to follow Practice Tips identified in this Handbook but these are not considered mandatory.a  Nothing in this Handbook should be construed to excuse the standing trustee from complying with all duties imposed by the Bankruptcy Code and Rules, local rules, and orders of the court.  The standing trustee should notify the United States Trustee whenever the provision of the Handbook conflicts with the local rules or orders of the court.  The standing trustee is accountable for all duties set forth in this Handbook, but need not personally perform any duty unless otherwise indicated.  Alluy   statutory references in this Handbook refer to the Bankruptcy Code, 11 U.S.C. § 101 et seq., unless otherwise indicated.zThis Handbook does not create additional rights against the standing trustee or United States Trustee in favor of other parties.

B.	ROLE OF THE UNITED STATES TRUSTEEa  The Bankruptcy Reform Act of 1978 removed the bankruptcy judge from the responsibilities for daytoday administration of cases.  Debtors, creditors, and third parties with adverse interests to the trustee were concerned that the court, which previously appointed and supervised the trustee, would not impartially adjudicate their rights as adversaries of that trustee. To address these concerns, judicial and administrative functions within the bankruptcy system were bifurcated.u  Many administrative functions formerly performed by the court were placed within the Department of Justice through the creation of the Program.  Among the administrative functions assigned to the United States Trustee were the appointment and supervision of chapter 13 trustees./  This Handbook is issued under the authority of the Program’s enabling statutes. 

C.	STATUTORY DUTIES OF A STANDING TRUSTEE	u  The standing trustee has a fiduciary responsibility to the bankruptcy estate.  The standing trustee is more than a mere disbursing agent.  The standing trustee must be personally involved in the trustee operation.  If the standing trustee is or becomes unable to perform the duties and responsibilities of a standing trustee, the standing trustee must immediately advise the United States Trustee.  28 U.S.C. § 586(b), 28 C.F.R. § 58.4(b) referencing 28 C.F.R. § 58.3(b).uO  Although this Handbook is not intended to be a complete statutory reference, the standing trustee’s primary statutory duties are set forth in 11 U.S.C. § 1302, which incorporates by reference some of the duties of chapter 7 trustees found in 11 U.S.C. § 704.  These duties include, but are not limited to, the following:

CopyrightN)r   r	   )filenamechunkss     a/var/www/html/ai-engine/env/lib/python3.11/site-packages/test_unstructured/chunking/test_basic.pyYtest_it_chunks_a_document_when_basic_chunking_strategy_is_specified_on_partition_functionr      s   .HH@@@F	
 	
 	b	
 	
 	S	
 	
 	c	
 	
 	4	
 	
 		
 	

 	c	
 	
 	_	
 	
 	\	
 	
 	'	
 	
{D D D D D D D    c                     t          d          t          d          g} t          | d          }|t          d          t          d          t          d          gk    sJ d S )NIntroductionzcLorem ipsum dolor sit amet consectetur adipiscing elit. In rhoncus ipsum sed lectus porta volutpat.@   )max_charactersz:Lorem ipsum dolor sit amet consectetur adipiscing elit. Inz(rhoncus ipsum sed lectus porta volutpat.)r   r
   r   r	   )elementsr   s     r   6test_it_chunks_elements_when_the_user_already_has_themr   `   s    n	
 	
H HR888F((UVVCDD	      r   c                 v   t          d          } t          d          }t          d          }t          | ||gdd          }t          |          dk    sJ |d         }|t	          d	          k    sJ |j        j        | |gk    sJ |d
         }|t	          d          k    sJ |j        j        |gk    sJ d S )Nr   z7Lorem ipsum dolor sit amet consectetur adipiscing elit.z+In rhoncus ipsum sed lectus porta volutpat.F   T)r   include_orig_elements   r   zEIntroduction

Lorem ipsum dolor sit amet consectetur adipiscing elit.   )r   r
   r   lenr	   metadataorig_elements)element	element_2	element_3r   chunks        r   =test_it_includes_original_elements_as_metadata_when_requestedr'   t   s    N##GNOOIBCCI	)Y'RV  F v;;!1IE$Q      >'GY+?????1IE$%RSSSSSS>'I;666666r   c                      e Zd ZdZej                            dddidfddidfddidfi dfg          dd            Z ej                    dd            Z	dS )Describe_chunk_elementszLUnit-test suite for `unstructured.chunking.basic.chunk_elements()` function.)kwargsexpected_valuer   TFNr*   dict[str, Any]r+   bool_chunk_elements_r   c                T    t          g fi | |j        j        \  }}|j        |u sJ d S )N)r   	call_argsargsr   )selfr*   r+   r.   _optss         r   ,it_supports_the_include_orig_elements_optionzDDescribe_chunk_elements.it_supports_the_include_orig_elements_option   sC     	r$$V$$$",14)^;;;;;;r   requestr   c                "    t          |d          S )Nz+unstructured.chunking.basic._chunk_elements)r   )r2   r6   s     r   r.   z(Describe_chunk_elements._chunk_elements_   s    W&STTTr   )r*   r,   r+   r-   r.   r   )r6   r   )
__name__
__module____qualname____doc__pytestmarkparametrizer5   fixturer.    r   r   r)   r)      s        VV[$%t,d3%u-u5%t,d3J		
 < < < < V^U U U U U Ur   r)   )r;   
__future__r   typingr   r<   test_unstructured.unit_utilsr   r   r   unstructured.chunking.basicr   unstructured.documents.elementsr	   r
   r   unstructured.partition.docxr   r   r   r'   r)   r@   r   r   <module>rG      s    # " " " " "        L L L L L L L L L L 6 6 6 6 6 6 I I I I I I I I I I 6 6 6 6 6 6J J JZ  (7 7 74U U U U U U U U U Ur   