+
    ¾¾j  ã                   óž   € R t ^ RIHtHt ^ RIHt ^ RIt^ RIHtHt ^ RI	H
t
 R tR tR tR	 tR
 tR tR tR tR tR tR tR tR tR tR# )z:Tests for issue #857: enhanced API usability improvements.)ÚdatetimeÚ	timedelta)ÚZoneInfoN)ÚCalendarÚEvent)ÚIncompleteComponentc                 ó„   € \         P                  ! RRRR7      p V P                  R8X  g   Q hV P                  R8X  g   Q hR# )zLTest Calendar.new() with organization and language. Generates proper prodid.úfoo.orgú
My partiesÚen©ÚorganizationÚnameÚlanguageú-//foo.org//My parties//ENN)r   ÚnewÚcalendar_nameÚprodid©Úcalendars    Új/home/ralf/ical-fahrzeuge/venv/lib/python3.14/site-packages/icalendar/tests/test_issue_857_enhanced_api.pyÚ0test_calendar_new_with_organization_and_languager      s<   € ä�|Š|¨¸ÐPTÔU€Hà×!Ñ! \Ô1Ð1Ð1Ø�?‰?Ð:Ô:Ð:Ò:ó    c                 ó\   € \         P                  ! RRR7      p V P                  R8X  g   Q hR# )zFTest Calendar.new() with organization but no language. Defaults to EN.úexample.comúTest Calendar©r   r   z!-//example.com//Test Calendar//ENN©r   r   r   r   s    r   Ú/test_calendar_new_with_organization_no_languager      s%   € ä�|Š|¨¸_ÔM€Hà�?‰?ÐAÔAÐAÒAr   c                 ó\   € \         P                  ! RRR7      p V P                  R8X  g   Q hR# )zCTest Calendar.new() with organization but no name. Uses 'Calendar'.r   Úfr)r   r   z-//example.com//Calendar//FRNr   r   s    r   Ú+test_calendar_new_with_organization_no_namer!      s%   € ä�|Š|¨ÀÔF€Hà�?‰?Ð<Ô<Ð<Ò<r   c                 ó`   € \         P                  ! RRRRR7      p V P                  R8X  g   Q hR# )zBTest that explicit prodid overrides organization-based generation.r	   r
   r   z-//Custom//Product//ID)r   r   r   r   Nr   r   s    r   Ú8test_calendar_new_explicit_prodid_overrides_organizationr#   "   s1   € ä�|Š|ØØØØ'ô	€Hð �?‰?Ð6Ô6Ð6Ò6r   c                 ó€   € \         P                  ! RR7      p RV P                  9   g   Q hRV P                  9   g   Q hR# )z7Test that without organization, default prodid is used.r   ©r   Ú
collectiveÚ	icalendarNr   r   s    r   Ú5test_calendar_new_no_organization_uses_default_prodidr(   .   s6   € ä�|Š| Ô1€Hð ˜8Ÿ?™?Ô*Ð*Ð*Ø˜(Ÿ/™/Ô)Ð)Ò)r   c            
     óì   € \         P                  ! R\        R^^^^4      R7      p \        ^R7      V n        V P                  \        ^R7      8X  g   Q hV P
                  \        R^^^^4      8X  g   Q hR# )z@Test that setting event duration. Correctly calculates end time.úTest Meetingéê  ©ÚsummaryÚstart©ÚhoursN)r   r   r   r   ÚdurationÚend©Úevents    r   Útest_event_duration_setterr5   7   sc   € ä�IŠI˜n´H¸TÀ1ÀbÈ"ÈbÓ4QÔR€Eô  QÔ'€E„Nà�>‰>œY¨QÔ/Ô/Ð/Ð/Ø�9‰9œ  q¨"¨b°"Ó5Ô5Ð5Ò5r   c            
     ó  € \        R^^^^\        R4      R7      p \        P                  ! RV R7      p\	        ^ZR7      Vn        V \	        ^ZR7      ,           pVP
                  \	        ^ZR7      8X  g   Q hVP                  V8X  g   Q hR# )z7Test duration setter. Works with timezone-aware events.r+   zEurope/London©Útzinfor*   r,   ©ÚminutesN)r   r   r   r   r   r1   r2   )Ú
start_timer4   Úexpected_ends      r   Ú(test_event_duration_setter_with_timezoner=   B   so   € ä˜$  2 r¨2´h¸Ó6OÔP€JÜ�IŠI˜n°JÔ?€Eä rÔ*€E„Nà¤	°"Ô 5Õ5€LØ�>‰>œY¨rÔ2Ô2Ð2Ð2Ø�9‰9˜Ô$Ð$Ò$r   c                 óØ   € \         P                  ! RR7      p \        P                  ! \        RR7      ;_uu_ 4        \        ^R7      V n        RRR4       R#   + '       g   i     R# ; i)z<Test that setting duration without start time. Raises error.zIncomplete Event)r-   z#Cannot set duration without DTSTART©Úmatchr/   N)r   r   ÚpytestÚraisesr   r   r1   r3   s    r   Ú5test_event_duration_setter_without_start_raises_errorrC   N   sK   € ä�IŠIÐ0Ô1€Eä	�ŠÜÐ#H÷
ö 
ô #¨Ô+ˆŒ÷
÷ 
÷ 
ò 
ús   ¼AÁA)	c            
     óL  € \        4       p V P                  RR4       \        P                  ! R\	        R^^^^4      R7      pV P                  V4       \        P                  ! \        RR7      ;_uu_ 4        V P                  4        RRR4       R#   + '       g   i     R# ; i)	z,Test that validate() detects missing PRODID.ÚVERSIONú2.0ÚTestr+   r,   zCalendar must have a PRODIDr?   N©
r   Úaddr   r   r   Úadd_componentrA   rB   r   Úvalidate©r   r4   s     r   Ú%test_calendar_validate_missing_prodidrM   X   sq   € ä‹z€HØ‡L�L�˜EÔ"Ü�IŠI˜f¬H°T¸1¸bÀ"ÀbÓ,IÔJ€EØ×Ñ˜5Ô!ä	�ŠÔ*Ð2O×	PÖ	PØ×ÑÔ÷ 
Q×	P×	PÒ	Púó   Á7BÂB#	c            
     óL  € \        4       p V P                  RR4       \        P                  ! R\	        R^^^^4      R7      pV P                  V4       \        P                  ! \        RR7      ;_uu_ 4        V P                  4        RRR4       R#   + '       g   i     R# ; i)	z-Test that validate() detects missing VERSION.ÚPRODIDú-//Test//Test//ENrG   r+   r,   zCalendar must have a VERSIONr?   NrH   rL   s     r   Ú&test_calendar_validate_missing_versionrR   c   sr   € ä‹z€HØ‡L�L�Ð.Ô/Ü�IŠI˜f¬H°T¸1¸bÀ"ÀbÓ,IÔJ€EØ×Ñ˜5Ô!ä	�ŠÔ*Ð2P×	QÖ	QØ×ÑÔ÷ 
R×	Q×	QÒ	QúrN   c                 ó  € \        4       p V P                  RR4       V P                  RR4       \        P                  ! \        RR7      ;_uu_ 4        V P                  4        RRR4       R#   + '       g   i     R# ; i)z,Test that validate() detects empty calendar.rP   rQ   rE   rF   z,Calendar must contain at least one componentr?   N)r   rI   rA   rB   r   rK   r   s    r   Ú$test_calendar_validate_no_componentsrT   n   s`   € ä‹z€HØ‡L�L�Ð.Ô/Ø‡L�L�˜EÔ"ä	�ŠÜÐ#Q÷
ö 
ð 	×ÑÔ÷
÷ 
÷ 
ò 
ús   ÁA.Á.A?	c                 ó   € \         P                  ! RR7      p \        P                  ! R\        R^^^^4      \        R^^^^4      R7      pV P	                  V4       V P                  4        V P                  4       pRV9   g   Q hRV9   g   Q hR# )	z2Test that validate() succeeds with valid calendar.zValid Calendarr%   z
Test Eventr+   )r-   r.   r2   s   BEGIN:VCALENDARs   BEGIN:VEVENTN)r   r   r   r   rJ   rK   Úto_ical)r   r4   Úical_outputs      r   Ú1test_calendar_validate_passes_with_valid_calendarrX   z   sŒ   € ä�|Š|Ð!1Ô2€HÜ�IŠIØÜ�t˜Q  B¨Ó+Ü�T˜1˜b " bÓ)ô€Eð
 ×Ñ˜5Ô!ð ×ÑÔð ×"Ñ"Ó$€KØ Ô,Ð,Ð,Ø˜kÔ)Ð)Ò)r   c            
     ó8  € \         P                  ! RRRR7      p \        R^^^^\        R4      R7      p\        P                  ! VR7      p\        ^R	7      Vn        R
Vn        V P                  R8X  g   Q hV P                  R8X  g   Q hVP                  V8X  g   Q hVP                  V\        ^R	7      ,           8X  g   Q hVP                  R
8X  g   Q hVP                  \        ^R	7      8X  g   Q hV P                  V4       V P                  4       pRV9   g   Q hR# )z:Test the exact workflow desired by the user in issue #857.r	   r
   r   r   r+   ÚUTCr7   )r.   r9   zSome stringr   s!   PRODID:-//foo.org//My parties//ENN)r   r   r   r   r   r   r1   r-   r   r   r.   r2   rJ   rV   )ÚcalÚ
mydatetimer4   rW   s       r   Ú)test_user_desired_workflow_from_issue_857r]   �   sþ   € ô �,Š, I°LÈ4Ô
P€Cô ˜$  2 r¨2´h¸u³oÔF€JÜ�IŠI˜JÔ'€Eô  rÔ*€E„Nð "€E„Mð ×Ñ Ô,Ð,Ð,Ø�:‰:Ð5Ô5Ð5Ð5Ø�;‰;˜*Ô$Ð$Ð$Ø�9‰9˜
¤Y°rÔ%:Õ:Ô:Ð:Ð:Ø�=‰=˜MÔ)Ð)Ð)Ø�>‰>œY¨rÔ2Ô2Ð2Ð2ð ×Ñ�eÔØ—+‘+“-€KØ/°;Ô>Ð>Ò>r   c                 ó¤  € \         P                  ! RRR7      p \        P                  ! R\        R^^^^ ^ \	        R4      R7      R7      p\        ^R	7      Vn        V P                  V4       V P                  4        V P                  4       P                  4       pR
V9   g   Q hRV9   g   Q hRV9   g   Q hRV9   g   Q hRV9   g   Q hRV9   g   Q hR# )zHTest that enhanced API is much simpler than original example from issue.r   zMy calendarr   z Python meeting about calendaringiÕ  rZ   r7   r,   r/   z-//example.com//My calendar//ENzVERSION:2.0zUID:zDTSTAMP:ÚDTSTARTÚDURATIONN)r   r   r   r   r   r   r1   rJ   Úadd_missing_timezonesrV   Údecode)r[   r4   rW   s      r   Ú.test_enhanced_api_compared_to_original_examplerc   ª   sÓ   € ô �,Š, M¸Ô
F€CÜ�IŠIØ2Ü�t˜Q  1 a¨´8¸E³?ÔCô€Eô  QÔ'€E„Nà×Ñ�eÔð ×ÑÔà—+‘+“-×&Ñ&Ó(€Kð -°Ô;Ð;Ð;à˜KÔ'Ð'Ð'à�[Ô Ð Ð Ø˜Ô$Ð$Ð$à˜Ô#Ð#Ð#à�kÔ!ðÚ!r   )Ú__doc__r   r   Úzoneinfor   rA   r'   r   r   Úicalendar.errorr   r   r   r!   r#   r(   r5   r=   rC   rM   rR   rT   rX   r]   rc   © r   r   Ú<module>rh      s^   ðÙ @ç (Ý ã ç %Ý /ò;òBò=ò	7ò*ò6ò	%ò,òòò	ò*ò&?ô:!r   