
    iB                     n   d Z ddlZddlmZmZmZmZ ddlmZ d Z	d Z
d Zd Zej        d	             Zej        d
             Z ej        eeg          d             Zej        d             Zd Zd Zd Zd Zd ZdedefdZdedefdZ ej        eeg          d             Zd Zd Zd ZdS )zTest conference properties.    N)CalendarEventTodovUri)
Conferencec                      t          j        t          d                    } | j        dk    sJ | j        J | j        J | j        J dS )zTest creation from a URI.(https://chat.example.com/audio?id=123456Nr   from_urir   urifeaturelabellanguage
conferences    _/root/projects/butler/venv/lib/python3.11/site-packages/icalendar/tests/prop/test_conference.pytest_from_empty_urir   	   sb    $T*T%U%UVVJ>GGGGG%%%###&&&&&    c            	          t          j        t          ddddd                    } | j        dk    sJ | j        dk    sJ | j        dk    sJ | j        dk    sJ dS )z(Create a conference with lots of values.r	   zPHONE,MODERATORModerator dial-inEN)FEATURELABELLANGUAGEparamsNr
   r   s    r   test_from_example_urir      s    $6,,  	
 	
 	
	 	J >GGGGG!2222222222$&&&&&&r   c                      t          dddddd          } t          j        |           }|                                }|| k    sJ |j        | j        k    sJ dS )	zTest creating a vURI.r	   PHONE	ModeratorDEURI)r   r   r   VALUEr   N)r   r   r   to_urir   )r   r   new_uris      r   test_to_urir&   $   sz    
2 	
 
  C $S))J!!Gc>>>>>SZ''''''r   c                      t          dddgd          } |                                 }t          |j        d         t                    sJ |j        d         dk    sJ |j        d         dk    sJ d	S )
zKEnsure list parameters are correctly serialized to comma-separated strings.zhttps://example.comAUDIOVIDEOzMeeting room)r   r   r   r   zAUDIO,VIDEOr   N)r   r$   
isinstancer   str)confvuris     r   )test_conference_list_params_serializationr.   5   s    !GW+=^  D ;;==Ddk),c22222;y!]2222;w>111111r   c                  D    t          j        t          d                    S )$Fixture for a conference with a URI.r	   )r   r   r    r   r   conference_1r2   B   s     t$NOOPPPr   c                  B    t          t          d          ddd          S )r0   r	   r   r   r   )r   r   r   )r   r   r1   r   r   conference_2r4   H   s0     788!	   r   r   c                     | j         S )z)Fixture to create a Conference component.)param)requests    r   component_classr8   S   s     =r   c                      |             S )zCreate a component.r1   )r8   s    r   	componentr:   Y   s     ?r   c                 ,    | j         g k    sJ d| vsJ dS )zNo conferences by default.
CONFERENCENconferences)r:   s    r   test_no_conferencesr?   _   s-     B&&&&y((((((r   c                 V    |g| _         | d         |                                k    sJ dS zAdd a new conference.r<   Nr>   r$   )r:   r2   s     r   test_add_conferencerC   e   s4    )NI\"l&9&9&;&;;;;;;;r   c                     ||g| _         | d         |                                |                                gk    sJ dS rA   rB   )r:   r2   r4   s      r   test_add_multiple_conferencesrE   k   sH    )<8I\"|':':'<'<l>Q>Q>S>S&TTTTTTTr   c                 T    |                      ||g          }|j        ||gk    sJ dS )z(Create a new component with conferences.r=   N)newr>   )r8   r2   r4   r:   s       r   #test_new_component_with_conferencesrH   q   s<    ##|0L#MMI \<$@@@@@@@r   c                     | g|_         |                                                    d          }d|v sJ d|v sJ d|v sJ dS )z$The URI start be in the ical string.zutf-8zCONFERENCE;z/audio?id=123456r   N)r>   to_icaldecode)r4   r:   ical_strs      r   test_uri_in_ical_rM   w   sd    )NI  ""))'22HH$$$$))))hr   calendarreturnc                     | j         d         S zGet the event directlyr   )events)rN   s    r   	get_eventrS      s    ?1r   c                 h    t          j        |                                           }|j        d         S rQ   )r   	from_icalrJ   rR   )rN   cals     r   get_serialized_eventrW      s*    

X--//
0
0C:a=r   c                 :    |j         }|                     |          S )zReturn the event from the file.)rfc_7986_conferencesr6   )r7   	calendarsrN   s      r   event_with_conferencesr[      s     -H=="""r   c                    t          | j                  dk    sJ | j        d         j        dk    sJ | j        d         j        dk    sJ | j        d         j        dk    sJ | j        d         j        d	k    sJ | j        d
         j        dk    sJ | j        d
         j        ddgk    sJ | j        d
         j        dk    sJ | j        d
         j        J dS )z*The conferences should be in the calendar.   r   ztel:+1-412-555-0123,,,654321   ztel:+1-412-555-0123,,,555123   ztel:+1-888-555-0456,,,555123   z$xmpp:chat-123@conference.example.com   r	   r(   r)   zAttendee dial-inN)lenr>   r   r   r   r   )r[   s    r   test_conferences_from_filerc      s   %122a7777!-a048VVVVV!-a048VVVVV!-a048VVVVV*1-11	2 	2 	2 	2 	*1-15	6 	6 	6 	6 "-a08Wg<NNNNN!-a06:LLLLL!-a09AAAAAr   c                  ~    t          j        d          } | j        dk    sJ | j        J | j        J | j        J dS )z"Create a conference from a string.ztel:+1-412-555-0123N)r   r   r   r   r   r   r   s    r   test_conference_from_stringre      sZ    $%:;;J>22222%%%###&&&&&r   c                  p    t          j        d          } |                                 }|j        dk    sJ dS )z;Conference created from a string should add the value type.z
http://asdr"   N)r   r   r$   r#   )r   r   s     r   $test_from_uri_string_adds_value_typerg      s<    $\22J




C9r   )__doc__pytest	icalendarr   r   r   r   icalendar.prop.conferencer   r   r   r&   r.   fixturer2   r4   r8   r:   r?   rC   rE   rH   rM   rS   rW   r[   rc   re   rg   r1   r   r   <module>rm      s   ! !  1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0' ' '' ' '$( ( ("
2 
2 
2 Q Q Q
    t}%%%  &%
   
) ) )< < <U U UA A A   U    
8      	#78999# # :9#B B B&' ' '    r   