dbustest

package
v0.0.0-...-072f331 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 4, 2025 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Overview

Package dbustest provides a helper to run an isolated bus instance in tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Available

func Available() bool

Available reports whether the required binaries are available for testing against a real DBus server.

Types

type Bus

type Bus struct {
	// contains filtered or unexported fields
}

Bus is an isolated DBus instance for tests.

func New

func New(t *testing.T, logMonitor bool) *Bus

New launches a DBus instance dedicated to the calling test.

If Available is false, New calls t.Skip to skip the calling test.

If logMonitor is true, the returned bus logs all bus messages using t.Logf.

func (*Bus) MustConn

func (b *Bus) MustConn(t *testing.T) *dbus.Conn

MustConn returns a connection to the bus. It causes an immediate test failure with t.Fatal if it is unable to connect.

func (*Bus) Socket

func (b *Bus) Socket() string

Socket returns the path to the bus's unix socket.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳