模拟 ModemManager 用于 dbus 的 golang 客户端。

huangapple go评论136阅读模式
英文:

Mocking ModemManager for dbus golang client

问题

我有一个使用ModemManager通过D-Bus配置wwan网络连接的Go程序。它使用了这个库:https://github.com/godbus/dbus。我想为我的应用程序编写测试,所以我需要以某种方式模拟ModemManager。我认为最好的方法是创建点对点连接,并在连接的另一端运行模拟的ModemManager服务器。

如何做到这一点?

英文:

I have an go program that config wwan network connection using ModemManager over D-Bus. It uses this library: https://github.com/godbus/dbus. I want to write tests for my application so I need to mock ModemManager somehow. I think that best way to do it is to create peer to peer connection and run mock ModemManager server on the other side of this connection.

How to do it?

答案1

得分: 1

你可以考虑使用python-dbusmock,不过你需要为其编写一个ModemManager模板,因为它本身没有提供这个功能。

英文:

Look at using python-dbusmock, though you will need to write a ModemManager template for it since it doesn’t have one already.

huangapple
  • 本文由 发表于 2023年2月14日 22:25:17
  • 转载请务必保留本文链接:https://go.coder-hub.com/75449223.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定