o
    .jl                     @   sD   d Z ddlZddlmZ dd Zdd Zdd	 Zd
d Zdd ZdS )zyTests for issue #1066: Calendar.new() should auto-generate UID.

See https://github.com/collective/icalendar/issues/1066
    N)Calendarc                 C   s,   t  }|jdusJ t|j| ksJ dS )zITest that Calendar.new() automatically generates a UID when not provided.N)r   newuidstr)test_uidcalendar r   a/home/thesage/.local/lib/python3.10/site-packages/icalendar/tests/test_issue_1066_calendar_uid.py$test_calendar_new_auto_generates_uid   s   r
   c                  C   s"   d} t j| d}|j| ksJ dS )z:Test that Calendar.new() respects explicitly provided UID.ztest-calendar-uidr   Nr   r   r   )
custom_uidr   r   r   r	   'test_calendar_new_respects_explicit_uid   s   r   c                  C   s0   t d} tj| d}t|jt| ksJ dS )z?Test that Calendar.new() accepts UUID objects as uid parameter.z$12345678-1234-5678-1234-567812345678r   N)uuidUUIDr   r   r   r   )custom_uuidr   r   r   r	   %test_calendar_new_accepts_uuid_object   s   
r   c                  C   s:   t jdd} |  }d|v sJ t| j |v sJ dS )zATest that the auto-generated UID appears in the iCalendar output.zTest Calendar)names   UID:N)r   r   to_icalr   r   encode)r   ical_outputr   r   r	   ,test_calendar_new_uid_appears_in_ical_output'   s   r   c                   C   s   t  jdus	J dS )z*Test the exact assertion from issue #1066.Nr   r   r   r   r	   "test_issue_1066_original_assertion3   s   r   )	__doc__r   	icalendarr   r
   r   r   r   r   r   r   r   r	   <module>   s    	