+
    WBiR                        R t RtRt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	t	^ RI
t
^ RIHt ^ RIHtHtHtHt ^ RIt^ RIt^ RIHtHtHt  ! R R]P0                  4      t ! R	 R
4      t ! R R]
P6                  4      t ! R R4      tR# )z3unittest.TestCase convenience methods for DBusMockszMartin PittzH
(c) 2012 Canonical Ltd.
(c) 2017 - 2022 Martin Pitt <martin@piware.de>
NPath)AnyDictOptionalTuple)
MOCK_IFACEOBJECT_MANAGER_IFACEload_modulec                   v   a  ] tR t^ t o RtRtRt]V 3R lR l4       tV 3R lR lt	R t
RV 3R	 lR
 lltRtV tR# )BusTypez"Represents a system or session bussessionsystemc                F   < V ^8  d   QhRS[ S[S[S[,          3,          /#    return)r   strr   )format__classdict__s   "6/usr/lib/python3.14/site-packages/dbusmock/testcase.py__annotate__BusType.__annotate__'   s"      sHSM12     c                    RV P                   P                  4        R2p\        P                  P	                  V4      pW3# )zDReturns the name and value of this bus' address environment variableDBUS__BUS_ADDRESS)valueupperosenvironget)selfenvr   s   &  r   r    BusType.environ&   s:     djj&&()6

s#zr   c                H   < V ^8  d   QhRS[ P                  P                  /# r   )dbusbus
Connection)r   r   s   "r   r   r   -   s     ! ! 3 3 !r   c                    V P                   w  rV'       d    \        P                  P                  V4      # V \        P
                  8X  d   \        P                  ! 4       # \        P                  ! 4       # )a;  Get a dbus.bus.BusConnection() object to this bus.

This uses the current environment variables for this bus (if any) and falls back
to dbus.SystemBus() or dbus.SessionBus() otherwise.

This is preferrable to dbus.SystemBus() and dbus.SessionBus() as those
do not get along with multiple changing local test buses.
)r    r&   r'   BusConnectionr   SYSTEM	SystemBus
SessionBus)r"   _vals   &  r   get_connectionBusType.get_connection-   sM     88))#..7>>!>>##  r   c                    V P                  4       pVP                  RR4      p\        P                  ! VR4      pVP	                  4        R# )z9Notify this bus that it needs to reload the configurationzorg.freedesktop.DBusz/org/freedesktop/DBusN)r0   
get_objectr&   	InterfaceReloadConfig)r"   r'   dbus_objdbus_ifs   &   r   reload_configurationBusType.reload_configuration=   s?    !!#>>"8:QR..+ABr   c                ,   < V ^8  d   QhRS[ RS[ RS[/# )r   destpathtimeout)r   float)r   r   s   "r   r   r   D   s'     Y Y Y3 Y Yr   c                   V P                  4       pRpV^ 8  d   VP                  V4      '       dH    \        P                  ! VP	                  W4      \        P
                  R7      pVP                  4        M!VR,          p\        P                  ! R4       K  V^ 8:  d   V^ 8  g   Q RV RV 24       hR# R#   \        P                  P                   d#   pTpR\        T4      9   d    Rp?KV   Rp?L|Rp?ii ; i)zWait for an object to appear on D-Bus

Raise an exception if object does not appear within one minute. You can
change the timeout in seconds with the "timeout" keyword argument.
Ndbus_interfacez.UnknownInterfaceg?z#timed out waiting for D-Bus object z: )r0   name_has_ownerr&   r4   r3   INTROSPECTABLE_IFACE
Introspect
exceptionsDBusExceptionr   timesleep)r"   r;   r<   r=   r'   last_excpes   &&&&    r   wait_for_bus_objectBusType.wait_for_bus_objectD   s     !!# k!!$''s~~d'ARVRkRklALLN sNGJJsOa<Q;X"EdV2hZ XX;  44  H*c!f4 5s   AB8 8C9C44C9 N)g      N@)__name__
__module____qualname____firstlineno____doc__SESSIONr+   propertyr    r0   r8   rL   __static_attributes____classdictcell__r   s   @r   r   r       sE     ,GF ! ! Y Y Yr   r   c                      a  ] tR t^at o RtV 3R lR ltV 3R lR ltR t]V 3R lR l4       t	]V 3R	 lR
 l4       t
]V 3R lR l4       tR tR tV 3R lR ltR tRtV tR# )PrivateDBusa+  A D-Bus daemon instance that represents a private session or system bus.

If used as a context manager it will automatically start the bus and clean up
after itself on exit:

    >>> with PrivateDBus(BusType.SESSION) as bus:
    >>>    do_something(bus)

Otherwise, `start()` and `stop()` manually.
c                    < V ^8  d   QhRS[ /# )r   bustype)r   )r   r   s   "r   r   PrivateDBus.__annotate__m   s     
 
 
r   c                   Wn         R V n        \        \        P                  ! RR7      4      V n        V P
                  V P                   P                   R2,          V n        V\        P                  8X  d   RMRpV P
                  V,          V n
        V P                  P                  RR7       V P                  RV P                   P                   R	2,          V n        V P                  P                  R
V P                   P                   RV P                   RV P                   P                   RV P                   R2	4       R # )Ndbusmock_data_)prefixz_bus.socketsystem-servicesservicesT)parents	dbusmock__cfgz<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-Bus Bus Configuration 1.0//EN"
     "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
    <busconfig>
      <type>z4</type>
      <keep_umask/>
      <listen>unix:path=z,</listen>
      <!-- We do not add standard_zW_servicedirs (i.e. we only have our private services directory). -->
      <servicedir>z</servicedir>
      <policy context="default">
        <allow send_destination="*" eavesdrop="true"/>
        <allow eavesdrop="true"/>
        <allow own="*"/>
      </policy>
    </busconfig>
    )r\   _daemonr   tempfilemkdtemp_datadirr   _socketr   r+   _servicedirmkdir_config
write_text)r"   r\   subdirs   && r   __init__PrivateDBus.__init__m   s   37X--5EFG}}$,,*<*<)=['II&-&?"Z==61t,''Idll6H6H5I*NN \\  ! '##'<<#5#5"6 7##$ %	
r   c                   < V ^8  d   QhRR/# )r   r   rZ   rN   )r   r   s   "r   r   r]      s      = r   c                B    V P                   f   V P                  4        V # N)rf   startr"   s   &r   	__enter__PrivateDBus.__enter__   s    <<JJLr   c                F    V P                   e   V P                  4        R # R # rt   )rf   stopr"   exc_typeexc_valexc_tbs   &&&&r   __exit__PrivateDBus.__exit__   s    <<#IIK $r   c                    < V ^8  d   QhRS[ /# r   r   )r   r   s   "r   r   r]      s     + + +r   c                J    V P                   f   Q R4       hRV P                   2# )znReturns this D-Bus' address in the environment variable format, i.e. something like
unix:path=/path/to/socket
Call start() firstz
unix:path=)rf   rj   rv   s   &r   addressPrivateDBus.address   s+    
 ||'=)=='DLL>**r   c                    < V ^8  d   QhRS[ /# r   r   )r   r   s   "r   r   r]      s        D  r   c                    V P                   # )zcThe services directory (full path) for any ``.service`` files that need to be known to
this D-Bus.
)rk   rv   s   &r   
servicedirPrivateDBus.servicedir   s    
 r   c                    < V ^8  d   QhRS[ /# r   )int)r   r   s   "r   r   r]      s        S  r   c                X    V P                   f   Q R4       hV P                   P                  # )z+Return the pid of this D-Bus daemon processr   )rf   pidrv   s   &r   r   PrivateDBus.pid   s*     ||'=)=='||r   c                n   RRV P                    2R.p\        P                  ! V\        P                  R7      V n        V P                  P
                  f   Q hV P                  P
                  P                  4       P                  4       p\        V4      V P                  P                  8X  g   Q R4       hV P                  P
                  P                  4        V P                  P                  4       '       g   Q R4       hV P                  P                  w  r4V P                  \         P                  V&   R# )zStart the D-Bus daemonzdbus-daemonz--config-file=z--print-pid=1)stdoutNzdbus-daemon pid mismatchzD-Bus socket not created)rm   
subprocessPopenPIPErf   r   readlinestripr   r   closerj   existsr\   r    r   r   )r"   argvr   r#   r.   s   &    r   ru   PrivateDBus.start   s    ~>P!''Z__E ||""...ll!!**,2243x4<<+++G-GG+!!#||""$$@&@@$%%,,

3r   c                x   V P                   '       d@    V P                   P                  4         V P                   P                  ^R7       RT n         \        P                  ! V P                  RR7       R#   \        P                   d    T P                   P                  4         L\i ; i  \         d     Lmi ; i)zStop the D-Bus daemonr=   NT)ignore_errors)
rf   	terminatewaitr   TimeoutExpiredkillProcessLookupErrorshutilrmtreeri   rv   s   &r   rz   PrivateDBus.stop   s    <<<&&((LL%%a%0
  DLdmm48 "00 (LL%%'(% s.   B+ A6 6/B(%B+ 'B((B+ +B98B9c                    < V ^8  d   QhRS[ /# )r   servicer   )r   r   s   "r   r   r]      s     0 0c 0r   c                R   \         P                  P                  R4      ;'       g    RpV P                  \        P
                  8X  d   RMRpVP                  R4       F  p\        V4      R,          V,          V R2,          pVP                  4       '       g   K>  V P                  P                  4       '       g   Q hV P                  V R2,          P                  V4        M	  \        RV R	V R
24      hV P                  '       d   V P                  P                  4        R# R# )aD  Enable the given well-known service name inside dbusmock

This symlinks a service file from the usual dbus service directories
into the dbusmock environment. Doing that allows the service to be
launched automatically if they are defined within $XDG_DATA_DIRS.

The daemon configuration is reloaded if a test bus is running.
XDG_DATA_DIRSz/usr/local/share/:/usr/share/ra   rb   :zdbus-1.serviceService z not found in XDG_DATA_DIRS ()N)r   r    r!   r\   r   r+   splitr   r   rk   
symlink_toAssertionErrorrf   r8   )r"   r   xdg_data_dirsro   dsrcs   &&    r   enable_servicePrivateDBus.enable_service   s     

7ZZ;Z&*llgnn&D"*$$S)Aq'H$v-7)80DDCzz||''..0000!!wix$88DDSI * !8G94QR_Q``a!bcc<<<LL--/ r   c                     V P                   V R2,          P                  4        T P                  '       d   T P
                  P                  4        R# R#   \         d    \        RT R24      Rhi ; i)Disable the given well known service name inside dbusmock

This unlink's the .service file for the service and reloads the
daemon configuration if a test bus is running.
r   r   z
 not foundN)rk   unlinkOSErrorr   rf   r\   r8   )r"   r   s   &&r   disable_servicePrivateDBus.disable_service   so    	K7)8 44<<> <<<LL--/   	K 8G9J!?@dJ	Ks   $A A2)rm   rf   ri   rk   rj   r\   N)rO   rP   rQ   rR   rS   rp   rw   r   rU   r   r   r   ru   rz   r   r   rV   rW   rX   s   @r   rZ   rZ   a   s}     	
 
: 
 + +        
'"90 0.0 0r   rZ   c                     a  ] tR t^t o RtRtRtRt]P                  R]P                  R/t]V 3R lR l4       t]RV 3R lR ll4       t]R 4       t]V 3R lR	 l4       t]V 3R
 lR l4       t]V 3R lR l4       t]RV 3R lR ll4       t]RV 3R lR ll4       t]RV 3R lR ll4       t]RV 3R lR ll4       t]RV 3R lR ll4       t]RV 3R lR ll4       tV 3R ltRtV tR# ) DBusTestCasea  Base class for D-Bus mock tests.

This provides some convenience API to start/stop local D-Buses, so that you
can run a private local session and/or system bus to run mocks on.

This also provides a spawn_server() static method to run the D-Bus mock
server in a separate process.
Nc                &   < V ^8  d   QhRS[ RS[/# )r   r\   r   )r   rZ   )r   r   s   "r   r   DBusTestCase.__annotate__  s     - -g -+ -r   c                    \         P                  P                  V 4      '       g   \        V 4      \         P                  V &   \         P                  V ,          # )zJReturn (and create if necessary) the singleton DBus for the given bus type)r   _bussesr!   rZ   r\   s   &r   _busDBusTestCase._bus  sA     ##''00,7,@L  )##G,,r   c                &   < V ^8  d   QhRS[ RS[/# r   
system_busr   )boolr   )r   r   s   "r   r   r     s     # #T #c #r   c                    \         P                  V '       d   \        P                  M\        P                  R7      p\        VP                  4      # )zReturns the private services directory for the bus type in question.
This allows dropping in a .service file so that the dbus server inside
dbusmock can launch it.
r   )r   r   r   r+   rT   r   r   )r   r'   s   & r   get_services_dirDBusTestCase.get_services_dir
  s2     *'//Z3>>""r   c                    \          Fk  p\        P                  P                  V4      pV'       g   K,  VP	                  4        \        \        VP                   R 2R4       \        P                  V Km  	  R# )_bus_pidN)r   r   r   r!   rz   setattrr   )clsr\   r'   s   &  r   tearDownClassDBusTestCase.tearDownClass  sU    G&&**73Cs
x&@$G ((1 r   c                   < V ^8  d   QhRR/# r   r   NrN   )r   r   s   "r   r   r     s     C Cd Cr   c                T   \        V4      p\        \        VP                   R 24      pVe   Q RV R24       h\        P                  P                  V4      e   Q h\        P                  V4      pVP                  4        \        \        VP                   R 2VP                  4       R# )r   NzPID z still alive?)
r   getattrr   r   r   r!   r   ru   r   r   )r   bus_typer\   old_pidr'   s   &&   r   __start_busDBusTestCase.__start_bus  s    (#,7==/(BC=$wi} ==##''0888(		x8#''Br   c                   < V ^8  d   QhRR/# r   rN   )r   r   s   "r   r   r   '  s     # #$ #r   c                (    V P                  R4       R# )zWSet up a private local session bus

This gets stopped automatically at class teardown.
r   N_DBusTestCase__start_busr   s   &r   start_session_busDBusTestCase.start_session_bus&  s     		"r   c                   < V ^8  d   QhRR/# r   rN   )r   r   s   "r   r   r   /  s     " " "r   c                (    V P                  R4       R# )zVSet up a private local system bus

This gets stopped automatically at class teardown.
r   Nr   r   s   &r   start_system_busDBusTestCase.start_system_bus.  s     	!r   c                :   < V ^8  d   QhRS[ RS[P                  /# r   )r   r&   Bus)r   r   s   "r   r   r   7  s     
( 
(T 
(dhh 
(r   c                r    V '       d   \         P                  M\         P                  pVP                  4       # )a  Get a dbus.bus.BusConnection() object to this bus

This is preferrable to dbus.SystemBus() and dbus.SessionBus() as those
do not get along with multiple changing local test buses.

This is a legacy method kept for backwards compatibility, use
BusType.get_connection() instead.
)r   r+   rT   r0   )r   r\   s   & r   get_dbusDBusTestCase.get_dbus6  s$     %/'..GOO%%''r   c                2   < V ^8  d   QhRS[ RS[ RS[RS[/# )r   r;   r<   r   r=   )r   r   r   )r   r   s   "r   r   r   D  s0     @ @# @S @d @UX @r   c                    V'       d   \         P                  M\         P                  pVP                  WVR,          4       R# )a)  Wait for an object to appear on D-Bus

Raise an exception if object does not appear within one minute. You can
change the timeout with the "timeout" keyword argument which specifies
deciseconds.

This is a legacy method kept for backwards compatibility, use
BusType.wait_for_bus_object() instead.
g      $@N)r   r+   rT   rL   )r;   r<   r   r=   r\   s   &&&& r   rL    DBusTestCase.wait_for_bus_objectC  s)     %/'..GOO##D$?r   c          
      L   < V ^8  d   QhRS[ RS[ RS[ RS[RS[P                  /# )r   namer<   	interfacer   r   )r   r   r   r   )r   r   s   "r   r   r   R  s7      3 c c t eoeueu r   c           	         V'       d   \         P                  M\         P                  p\        P	                  WW%VRR7      pVP
                  # )a  Run a DBusMockObject instance in a separate process

The daemon will terminate automatically when the D-Bus that it connects
to goes down.  If that does not happen (e. g. you test on the actual
system/session bus), you need to kill it manually.

This function blocks until the spawned DBusMockObject is ready and
listening on the bus.

Returns the Popen object of the spawned daemon.

This is a legacy method kept for backwards compatibility,
use SpawnedMock.spawn_for_name() instead.
Nr   stderr)r   r+   rT   SpawnedMockspawn_for_nameprocess)r   r<   r   r   r   r\   servers   &&&&&  r   spawn_serverDBusTestCase.spawn_serverQ  s:      %/'..GOO++D	SYbf+g~~r   c          
         < V ^8  d   QhRS[ RS[S[S[ S[3,          ,          RS[S[,          RS[S[P                  S[P                  P                  3,          /# )r   template
parametersr   r   )r   r   r   r   r   r   r   r   r&   proxiesProxyObject)r   r   s   "r   r   r   f  sZ     * **#+DcN#;*]efj]k*	z!9!99	:*r   c                    Ve*   V'       d   \         P                  M\         P                  pMRp\        P	                  WWBRR7      pVP
                  VP                  3# )a  Run a D-Bus mock template instance in a separate process

This starts a D-Bus mock process and loads the given template with
(optional) parameters into it. For details about templates see
dbusmock.DBusMockObject.AddTemplate().

Usually a template should specify SYSTEM_BUS = False/True to select whether it
gets loaded on the session or system bus. This can be overridden with the system_bus
parameter. For templates which don't set SYSTEM_BUS, this parameter has to be set.

The daemon will terminate automatically when the D-Bus that it connects
to goes down.  If that does not happen (e. g. you test on the actual
system/session bus), you need to kill it manually.

This function blocks until the spawned DBusMockObject is ready and
listening on the bus.

Returns a pair (daemon Popen object, main dbus object).

This is a legacy method kept for backwards compatibility,
use SpawnedMock.spawn_with_template() instead.
N)r   )r   r+   rT   r   spawn_with_templater   obj)r   r   r   r   r\   r   s   &&&&  r   spawn_server_template"DBusTestCase.spawn_server_templatee  sK    4 !(2gnnGG00w_c0d~~vzz))r   c                $   < V ^8  d   QhRS[ RR/# r   r   r   Nr   )r   r   s   "r   r   r     s     $ $D $T $r   c                    V'       d   \         P                  M\         P                  p\        P	                  V4      pVP                  V 4       R# )a  Enable the given well known service name inside dbusmock

This symlinks a service file from the usual dbus service directories
into the dbusmock environment. Doing that allows the service to be
launched automatically if they are defined within $XDG_DATA_DIRS.

The daemon configuration is reloaded if a test bus is running.

This is a legacy method kept for backwards compatibility. Use
PrivateDBus.enable_service() instead.
N)r   r+   rT   r   r   r   r   r   r\   r'   s   &&  r   r   DBusTestCase.enable_service  s3     %/'..GOO(7#r   c                $   < V ^8  d   QhRS[ RR/# r  r  )r   r   s   "r   r   r     s     % %T %d %r   c                    V'       d   \         P                  M\         P                  p\        P	                  V4      pVP                  V 4       R# )r   N)r   r+   rT   r   r   r   r  s   &&  r   r   DBusTestCase.disable_service  s3     %/'..GOO(G$r   c                <   < V ^8  d   Qh/ S[ S[S[3,          ;R&   # )r   r   )r   r   rZ   )r   r   s   "r   r   r      s      ';&'  r   rN   )F)FiX  )FN)NNN)rO   rP   rQ   rR   rS   session_bus_pidsystem_bus_pid_DBusTestCase__datadirr   rT   r+   r   staticmethodr   r   classmethodr   r   r   r   r   rL   r   r  r   r   __annotate_func__rV   rW   rX   s   @r   r   r      sV     ON!+G
 - - # # # 2 2 C C # # " " 
( 
( 
( @ @ @   & * * *@ $ $ $  % % %O  r   r   c                   R  a  ] tR tRt o RtV 3R lR lt]V 3R lR l4       t]R 4       tV 3R lR	 lt	R
 t
R t]R 4       t]R 4       t]]P                   ]P$                  ]P$                  3V 3R lR ll4       t]RR]P$                  ]P$                  3V 3R lR ll4       tRtV tR# )r   i  z
An instance of a D-Bus mock template instance in a separate process.

See SpawnedMock.spawn_for_name() and SpawnedMock.spawn_with_template()
the typical entry points.
c                b   < V ^8  d   QhRS[ P                  RS[P                  P                  /# )r   r   r   )r   r   r&   r   r   )r   r   s   "r   r   SpawnedMock.__annotate__  s+      
 0 0 t||7O7O r   c                ,    Wn         R V n        W n        R# )TN)_process_process_is_running_obj)r"   r   r   s   &&&r   rp   SpawnedMock.__init__  s    #' 	r   c                4   < V ^8  d   QhRS[ P                  /# r   )r   r   )r   r   s   "r   r   r    s      )) r   c                    V P                   # )z.Returns the process that is this mock template)r  rv   s   &r   r   SpawnedMock.process  s     }}r   c                    V P                   # )z,The D-Bus object this server was spawned for)r  rv   s   &r   r   SpawnedMock.obj  s     yyr   c                   < V ^8  d   QhRR/# )r   r   r   rN   )r   r   s   "r   r   r    s      = r   c                    V # rt   rN   rv   s   &r   rw   SpawnedMock.__enter__  s    r   c                &    V P                  4        R # rt   )r   r{   s   &&&&r   r   SpawnedMock.__exit__  s    r   c                   V P                   P                  f   V P                   P                  4        V P                   P                  f   V P                   P                  '       d%   V P                   P                  P	                  4        V P                   P
                  '       d%   V P                   P
                  P	                  4         V P                   P                  4         V P                   P                  ^R7       R# R#   \        P                   d    T P                   P                  4         R# i ; i  \         d     R# i ; i)zTerminate the processNr   )r  
returncodepollr   r   r   r   r   r   r   r   r   rv   s   &r   r   SpawnedMock.terminate  s    ==##+MM ==##+}}###$$**,}}###$$**,''))MM&&q&1 , "00 )MM&&()% s0   D= 'D /D:6D= 9D::D= =EEc                .    V P                   P                  # )zu
The stdout of the process, if no caller-specific stdout
was specified in spawn_for_name() or spawn_with_template().
)r  r   rv   s   &r   r   SpawnedMock.stdout       }}###r   c                .    V P                   P                  # )zu
The stderr of the process, if no caller-specific stderr
was specified in spawn_for_name() or spawn_with_template().
)r  r   rv   s   &r   r   SpawnedMock.stderr  r+  r   c          
      6   < V ^8  d   QhRS[ RS[ RS[ RS[RR/# )r   r   r<   r   r\   r   r   )r   r   )r   r   s   "r   r   r    s=     !, !,!, !, 	!,
 !, 
!,r   c                :   \         P                  RRRVP                   2WV.pVP                  4       pVP	                  V4      '       d   \        RV R24      h\        P                  ! WuVR7      p	VP                  W4       VP                  W4      p
V ! WR7      # )a  Run a DBusMockObject instance in a separate process

The daemon will terminate automatically when the D-Bus that it connects
to goes down.  If that does not happen (e. g. you test on the actual
system/session bus), you need to kill it manually.

This function blocks until the spawned DBusMockObject is ready and
listening on the bus.

By default, stdout and stderr of the spawned process is available via the
SpawnedMock.stdout and SpawnedMock.stderr properties on the returned object.
z-mdbusmockz--z"Trying to spawn a server for name z but it is already owned!r   )r   r   )
sys
executabler   r0   rB   r   r   r   rL   r3   )r   r   r<   r   r\   r   r   r   r'   daemonr   s   &&&&&&&    r   r   SpawnedMock.spawn_for_name  s    , jBw}}o2FT]^$$&d## #EdVKd!eff !!$fE 	##D/nnT(6++r   Nc                b   < V ^8  d   QhRS[ RS[S[S[ S[3,          ,          RS[S[,          /# )r   r   r   r\   )r   r   r   r   r   )r   r   s   "r   r   r    s;     / // T#s(^,/ '"	/r   c                   \        V4      p\        VR4      '       d   VP                  MRpV'       d   \        VR4      '       g   \        pMVP                  pVf3   VP
                  '       d   \        P                  M\        P                  pVf   Q h\        P                  VP                  VP                  WWE4      p	V'       g   \        P                  ! / RR7      pV	P                  P!                  W\"        R7       V	# )a/  Run a D-Bus mock template instance in a separate process

This starts a D-Bus mock process and loads the given template with
(optional) parameters into it. For details about templates see
dbusmock.DBusMockObject.AddTemplate().

Usually a template should specify SYSTEM_BUS = False/True to select whether it
gets loaded on the session or system bus. This can be overridden with the system_bus
parameter. For templates which don't set SYSTEM_BUS, this parameter has to be set.

The daemon will terminate automatically when the D-Bus that it connects
to goes down.  If that does not happen (e. g. you test on the actual
system/session bus), you need to kill it manually.

This function blocks until the spawned DBusMockObject is ready and
listening on the bus.

Returns a pair (daemon Popen object, main dbus object).
IS_OBJECT_MANAGERF
MAIN_IFACEsv)	signaturer@   )r
   hasattrr7  r	   r8  
SYSTEM_BUSr   r+   rT   r   r   BUS_NAMEMAIN_OBJr&   
Dictionaryr   AddTemplater   )
r   r   r   r\   r   r   moduleis_object_managerinterface_namer   s
   &&&&&&    r   r   SpawnedMock.spawn_with_template  s    < X&8?H[8\8\F44bgWV\%B%B1N#..N?(.(9(9(9gnnwG"""++FOOV__ngmvt<J

xJOr   )r  r  r  )rO   rP   rQ   rR   rS   rp   rU   r   r   rw   r   r   r   r   r  r   rT   r   r   r   r   rV   rW   rX   s   @r   r   r     s      
     & $ $ $ $  #??!, !, !,F  04%)/ / /r   r   )rS   
__author____copyright__enumr   r   r   r1  rg   rG   unittestpathlibr   typingr   r   r   r   r&   dbus.proxiesdbusmock.mockobjectr   r	   r
   Enumr   rZ   TestCaser   r   rN   r   r   <module>rO     s    9 

  	   
     - -   M M>Ydii >YBM0 M0`o%8$$ o%dT Tr   