dbusmock.templates.polkitd

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

__author__

__copyright__

BUS_NAME

MAIN_OBJ

MAIN_IFACE

SYSTEM_BUS

Functions

load(mock, _parameters)

CheckAuthorization(self, _subject, action_id, ...)

RegisterAuthenticationAgent(_self, _subject, _locale, ...)

AllowUnknown(self, default)

Control whether unknown actions are allowed

SetAllowed(self, actions)

Set allowed actions

SetDelay(self, delay)

Makes the CheckAuthorization() method to delay

SimulateHang(self, hang)

Makes the CheckAuthorization() method to hang

SimulateHangActions(self, actions)

Makes the CheckAuthorization() method to hang on such actions

ReleaseHangingCalls(self)

Calls all the hanging callbacks

HaveHangingCalls(self)

Check if we've hangling calls

Module Contents

dbusmock.templates.polkitd.__author__ = 'Martin Pitt'[source]
Show Value
"""
(c) 2013-2021 Canonical Ltd.
(c) 2017 - 2022 Martin Pitt <martin@piware.de>
"""
dbusmock.templates.polkitd.BUS_NAME = 'org.freedesktop.PolicyKit1'[source]
dbusmock.templates.polkitd.MAIN_OBJ = '/org/freedesktop/PolicyKit1/Authority'[source]
dbusmock.templates.polkitd.MAIN_IFACE = 'org.freedesktop.PolicyKit1.Authority'[source]
dbusmock.templates.polkitd.SYSTEM_BUS = True[source]
dbusmock.templates.polkitd.load(mock, _parameters)[source]
dbusmock.templates.polkitd.CheckAuthorization(self, _subject, action_id, _details, _flags, _cancellation_id, ok_cb, _err_cb)[source]
dbusmock.templates.polkitd.RegisterAuthenticationAgent(_self, _subject, _locale, _object_path)[source]
dbusmock.templates.polkitd.AllowUnknown(self, default)[source]

Control whether unknown actions are allowed

This controls the return value of CheckAuthorization for actions which were not explicitly allowed by SetAllowed().

dbusmock.templates.polkitd.SetAllowed(self, actions)[source]

Set allowed actions

dbusmock.templates.polkitd.SetDelay(self, delay)[source]

Makes the CheckAuthorization() method to delay

dbusmock.templates.polkitd.SimulateHang(self, hang)[source]

Makes the CheckAuthorization() method to hang

dbusmock.templates.polkitd.SimulateHangActions(self, actions)[source]

Makes the CheckAuthorization() method to hang on such actions

dbusmock.templates.polkitd.ReleaseHangingCalls(self)[source]

Calls all the hanging callbacks

dbusmock.templates.polkitd.HaveHangingCalls(self)[source]

Check if we’ve hangling calls