D-Bus test: make TestDBusServer.testGetConfigsTemplates pass regardless of the environment
The test used to fail if the user running the test had SyncML capable devices paired via Bluez. Now the BluezManager is told to not use Bluez in this particular test.
This commit is contained in:
parent
197f9386fc
commit
41c08af6a6
|
@ -37,7 +37,10 @@ BluezManager::BluezManager(Server &server) :
|
|||
m_adapterChanged(*this, "DefaultAdapterChanged")
|
||||
{
|
||||
const char *bluetoothTest = getenv ("DBUS_TEST_BLUETOOTH");
|
||||
m_bluezConn = b_dbus_setup_bus(bluetoothTest ? DBUS_BUS_SESSION: DBUS_BUS_SYSTEM, NULL, true, NULL);
|
||||
m_bluezConn = (bluetoothTest && !strcmp(bluetoothTest, "none")) ? NULL :
|
||||
b_dbus_setup_bus((bluetoothTest && !strcmp(bluetoothTest, "session")) ?
|
||||
DBUS_BUS_SESSION : DBUS_BUS_SYSTEM,
|
||||
NULL, true, NULL);
|
||||
if(m_bluezConn) {
|
||||
m_done = false;
|
||||
DBusClientCall1<DBusObject_t> getAdapter(*this, "DefaultAdapter");
|
||||
|
|
|
@ -749,6 +749,7 @@ class TestDBusServer(unittest.TestCase, DBusUtil):
|
|||
configs = self.server.GetConfigs(False, utf8_strings=True)
|
||||
self.assertEqual(configs, [])
|
||||
|
||||
@property("ENV", "DBUS_TEST_BLUETOOTH=none")
|
||||
def testGetConfigsTemplates(self):
|
||||
"""TestDBusServer.testGetConfigsTemplates - Server.GetConfigsTemplates()"""
|
||||
configs = self.server.GetConfigs(True, utf8_strings=True)
|
||||
|
|
Loading…
Reference in New Issue