dbusmock.templates.polkitd ========================== .. py:module:: dbusmock.templates.polkitd .. autoapi-nested-parse:: polkitd mock template This creates the expected methods and properties of the main org.freedesktop.PolicyKit1 object. By default, all actions are rejected. You can call AllowUnknown() and SetAllowed() on the mock D-Bus interface to control which actions are allowed. Attributes ---------- .. autoapisummary:: dbusmock.templates.polkitd.__author__ dbusmock.templates.polkitd.__copyright__ dbusmock.templates.polkitd.BUS_NAME dbusmock.templates.polkitd.MAIN_OBJ dbusmock.templates.polkitd.MAIN_IFACE dbusmock.templates.polkitd.SYSTEM_BUS Functions --------- .. autoapisummary:: dbusmock.templates.polkitd.load dbusmock.templates.polkitd.CheckAuthorization dbusmock.templates.polkitd.RegisterAuthenticationAgent dbusmock.templates.polkitd.AllowUnknown dbusmock.templates.polkitd.SetAllowed dbusmock.templates.polkitd.SetDelay dbusmock.templates.polkitd.SimulateHang dbusmock.templates.polkitd.SimulateHangActions dbusmock.templates.polkitd.ReleaseHangingCalls dbusmock.templates.polkitd.HaveHangingCalls Module Contents --------------- .. py:data:: __author__ :value: 'Martin Pitt' .. py:data:: __copyright__ :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """ (c) 2013-2021 Canonical Ltd. (c) 2017 - 2022 Martin Pitt """ .. raw:: html
.. py:data:: BUS_NAME :value: 'org.freedesktop.PolicyKit1' .. py:data:: MAIN_OBJ :value: '/org/freedesktop/PolicyKit1/Authority' .. py:data:: MAIN_IFACE :value: 'org.freedesktop.PolicyKit1.Authority' .. py:data:: SYSTEM_BUS :value: True .. py:function:: load(mock, _parameters) .. py:function:: CheckAuthorization(self, _subject, action_id, _details, _flags, _cancellation_id, ok_cb, _err_cb) .. py:function:: RegisterAuthenticationAgent(_self, _subject, _locale, _object_path) .. py:function:: AllowUnknown(self, default) Control whether unknown actions are allowed This controls the return value of CheckAuthorization for actions which were not explicitly allowed by SetAllowed(). .. py:function:: SetAllowed(self, actions) Set allowed actions .. py:function:: SetDelay(self, delay) Makes the CheckAuthorization() method to delay .. py:function:: SimulateHang(self, hang) Makes the CheckAuthorization() method to hang .. py:function:: SimulateHangActions(self, actions) Makes the CheckAuthorization() method to hang on such actions .. py:function:: ReleaseHangingCalls(self) Calls all the hanging callbacks .. py:function:: HaveHangingCalls(self) Check if we've hangling calls