martinpitt / umockdev

Mock hardware devices for creating unit tests and bug reporting
https://launchpad.net/umockdev
GNU Lesser General Public License v2.1
308 stars 55 forks source link

How to emulate wireless device battery? #198

Closed DemosKadi closed 2 years ago

DemosKadi commented 2 years ago

Hey, I'm writing a small library which is basically wrapping upower and umockdev seems perfect for testing. The only problem I have is, that I can not figure out how to emulate for example a bluetooth mouse so that upower recognizes it as a wireless device. I even used umockdev-record on my Logitech Mx Master but upower still only sees a battery. Could anyone help me with this?

benzea commented 2 years ago

I would suggest just emulating upower itself using python-dbusmock.

In this case, it might be that you need to go through bluetoothd actually.

DemosKadi commented 2 years ago

Thanks python-dbusmock looks like it would be exactly what I need