How to write a functional test for a DBUS service written in Python?

前端 未结 6 1613
忘掉有多难
忘掉有多难 2021-01-02 01:16

(Title was: \"How to write a unit test for a DBUS service written in Python?\")

I\'ve started to write a DBUS service using dbus-python, but I\'m having trouble writ

6条回答
  •  盖世英雄少女心
    2021-01-02 02:03

    Simple solution: don't unit test through dbus.

    Instead write your unit tests to call your methods directly. That fits in more naturally with the nature of unit tests.

    You might also want some automated integration tests, that check running through dbus, but they don't need to be so complete, nor run in isolation. You can have setup that starts a real instance of your server, in a separate process.

提交回复
热议问题