mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2024-12-23 07:22:24 +00:00
29 lines
686 B
TypeScript
29 lines
686 B
TypeScript
|
import * as dbus from 'dbus';
|
||
|
import { DBusError, DBusInterface } from 'dbus';
|
||
|
import { stub } from 'sinon';
|
||
|
|
||
|
stub(dbus, 'getBus').returns({
|
||
|
getInterface: (
|
||
|
_serviceName: string,
|
||
|
_objectPath: string,
|
||
|
_interfaceName: string,
|
||
|
interfaceCb: (err: null | DBusError, iface: DBusInterface) => void,
|
||
|
) => {
|
||
|
interfaceCb(null, {
|
||
|
Get: (
|
||
|
_unitName: string,
|
||
|
_property: string,
|
||
|
getCb: (err: null | Error, value: unknown) => void,
|
||
|
) => {
|
||
|
getCb(null, 'this is the value');
|
||
|
},
|
||
|
GetUnit: (
|
||
|
_unitName: string,
|
||
|
getUnitCb: (err: null | Error, unitPath: string) => void,
|
||
|
) => {
|
||
|
getUnitCb(null, 'this is the unit path');
|
||
|
},
|
||
|
} as any);
|
||
|
},
|
||
|
} as any);
|