~unity-team/libqtdbusmock/trunk

« back to all changes in this revision

Viewing changes to tests/libqtdbusmock/TestDBusMock.cpp

  • Committer: CI Train Bot
  • Author(s): Pete Woods
  • Date: 2015-10-09 11:12:07 UTC
  • mfrom: (41.1.1 trunk)
  • Revision ID: ci-train-bot@canonical.com-20151009111207-twzzifiy5ww3asgh
Enable the passing of parameters to templates. Add extra templates. Fix version number of registerTemplate symbol (marked 0changeme). Depend on python-dbusmock >= 0.16

Show diffs side-by-side

added added

removed removed

Lines of Context:
101
101
        ASSERT_EQ(1, devices.value().size());
102
102
}
103
103
 
 
104
TEST_F(TestDBusMock, StartsDBusMockTemplateParameters) {
 
105
        dbusMock.registerUpower({{"DaemonVersion", "0.99.0"}, {"OnBattery", true}});
 
106
        dbusTestRunner.startServices();
 
107
 
 
108
        EXPECT_TRUE(
 
109
                        processListContains(
 
110
                                        "python3 -m dbusmock --template upower --parameters {\"DaemonVersion\":\"0.99.0\",\"OnBattery\":true}"));
 
111
 
 
112
        QDBusInterface iface("org.freedesktop.UPower", "/org/freedesktop/UPower",
 
113
                        "org.freedesktop.UPower", dbusTestRunner.systemConnection());
 
114
 
 
115
        EXPECT_EQ("0.99.0", iface.property("DaemonVersion").toString());
 
116
        EXPECT_TRUE(iface.property("OnBattery").toBool());
 
117
}
 
118
 
104
119
TEST_F(TestDBusMock, StartsDBusMockWithTemplate) {
105
120
        dbusMock.registerTemplate(NM_DBUS_SERVICE,
106
121
                                  "networkmanager",