
    h                     l    S r SSKJr   " S S\5      r " S S\5      r " S S\5      r " S	 S
\5      rg)z1
testing of YAML.register_class and @yaml_object
   )YAMLc                       \ rS rSrS rSrg)User0
   c                     Xl         X l        g Nnameageselfr
   r   s      e/home/james-whalen/.local/lib/python3.13/site-packages/srsly/tests/ruamel_yaml/test_class_register.py__init__User0.__init__       	    r   r
   N__name__
__module____qualname____firstlineno__r   __static_attributes__ r   r   r   r   
   s    r   r   c                   >    \ rS rSrSrS r\S 5       r\S 5       rSr	g)User1   z!userc                     Xl         X l        g r   r	   r   s      r   r   User1.__init__   r   r   c                 X    UR                  U R                  SR                  X"5      5      $ Nz{.name}-{.age}represent_scalaryaml_tagformatclsrepresenternodes      r   to_yamlUser1.to_yaml   s*    ++LL+224>
 	
r   c                 >    U " UR                   R                  S5      6 $ N-valuesplitr'   constructorr)   s      r   	from_yamlUser1.from_yaml   s    DJJ$$S)**r   r   N
r   r   r   r   r$   r   classmethodr*   r4   r   r   r   r   r   r      s4    H 
 

 + +r   r   c                   8    \ rS rSrS rS rS rS rS rS r	Sr
g	)
TestRegisterClass"   c                     [        5       nUR                  [        5        SnUR                  U5      nUR	                  X2SS9  g )NzC
        - !User0
          name: Anthon
          age: 18
        Tcompareunordered_linesr   register_classr   loaddumpr   yamlysds       r   test_register_0_rt$TestRegisterClass.test_register_0_rt#   s=    vE"
 IIbM		!	6r   c                     [        SS9nUR                  [        5        SnUR                  U5      nUR	                  X2S9  g )Nsafetyp2
        - !User0 {age: 18, name: Anthon}
        r=   r?   rC   s       r   test_register_0_safe&TestRegisterClass.test_register_0_safe.   s>    E" IIbM		!	 r   c                     [        SS9nUR                  [        5        SnUR                  U5      nUR	                  X2S9  g )NunsaferK   rM   rN   r?   rC   s       r   test_register_0_unsafe(TestRegisterClass.test_register_0_unsafe8   s>    !E" IIbM		!	 r   c                     [        5       nUR                  [        5        SnUR                  U5      nUR	                  X2S9  g )Nz#
        - !user Anthon-18
        rN   r   r@   r   rA   rB   rC   s       r   test_register_1_rt$TestRegisterClass.test_register_1_rtB   s;    vE" IIbM		!	 r   c                     [        SS9nUR                  [        5        SnUR                  U5      nUR	                  X2S9  g )NrJ   rK   #
        [!user Anthon-18]
        rN   rV   rC   s       r   test_register_1_safe&TestRegisterClass.test_register_1_safeK   s>    E" IIbM		!	 r   c                     [        SS9nUR                  [        5        SnUR                  U5      nUR	                  X2S9  g )NrR   rK   rZ   rN   rV   rC   s       r   test_register_1_unsafe(TestRegisterClass.test_register_1_unsafeT   s>    !E" IIbM		!	 r   r   N)r   r   r   r   rG   rO   rS   rW   r[   r^   r   r   r   r   r9   r9   "   s     	7!!!!!r   r9   c                        \ rS rSrS rS rSrg)TestDecorator^   c                     SSK Jn  [        5       nU" U5       " S S[        5      5       nSnUR	                  U5      nUR                  XTSS9  g )N    yaml_objectc                       \ rS rSrS rSrg)4TestDecorator.test_decorator_implicit.<locals>.User2d   c                     Xl         X l        g r   r	   r   s      r   r   =TestDecorator.test_decorator_implicit.<locals>.User2.__init__f        	r   r   Nr   r   r   r   User2rh   d   s    r   rm   zC
        - !User2
          name: Anthon
          age: 18
        Tr<   srsly.ruamel_yamlrf   r   objectrA   rB   )r   rf   ymlrm   rE   rF   s         r   test_decorator_implicit%TestDecorator.test_decorator_implicit_   sP    1f	S		F 	 
	

 HHRL5r   c                     SSK Jn  [        5       nU" U5       " S S[        5      5       nSnUR	                  U5      nUR                  XTS9  g )Nrd   re   c                   >    \ rS rSrSrS r\S 5       r\S 5       rSr	g)4TestDecorator.test_decorator_explicit.<locals>.User3w   z!USERc                     Xl         X l        g r   r	   r   s      r   r   =TestDecorator.test_decorator_explicit.<locals>.User3.__init__{   rl   r   c                 X    UR                  U R                  SR                  X"5      5      $ r!   r"   r&   s      r   r*   <TestDecorator.test_decorator_explicit.<locals>.User3.to_yaml   s*    "33LL"3":":4"F r   c                 >    U " UR                   R                  S5      6 $ r-   r/   r2   s      r   r4   >TestDecorator.test_decorator_explicit.<locals>.User3.from_yaml   s    DJJ,,S122r   r   Nr6   r   r   r   User3rv   w   s4    H  
 3 3r   r~   z#
        - !USER Anthon-18
        rN   rn   )r   rf   rq   r~   rE   rF   s         r   test_decorator_explicit%TestDecorator.test_decorator_explicitr   sN    1f	S		3F 	3 
	3" HHRLr   r   N)r   r   r   r   rr   r   r   r   r   r   ra   ra   ^   s    6& r   ra   N)__doc__	roundtripr   rp   r   r   r9   ra   r   r   r   <module>r      s@    F +F +$9! 9!x/ F / r   