D-Bus testing: avoid test failures due to GNOME keyring side effects

The auto-sync tests modified the GNOME keyring by setting a password
for the same URL that is also used in the password request tests,
which caused those tests to fail.

Ideally this would be fixed by running each test with a fresh GNOME
keyring, but this is hard to set up. Instead solve the problem by
keeping the URLs separate.
This commit is contained in:
Patrick Ohly 2011-07-13 15:54:49 +02:00
parent 0c5e98e076
commit 811d10fc33
1 changed files with 5 additions and 0 deletions

View File

@ -1283,6 +1283,7 @@ class TestSessionAPIsDummy(unittest.TestCase, DBusUtil):
self.config = {
"" : { "syncURL" : "http://impossible-syncurl-just-for-testing-to-avoid-conflict",
"username" : "unknown",
# the password request tests depend on not having a real password here
"password" : "-",
"deviceId" : "foo",
"RetryInterval" : "10",
@ -1872,6 +1873,10 @@ class TestSessionAPIsDummy(unittest.TestCase, DBusUtil):
self.setupConfig()
# enable auto-sync
config = self.config
# Note that writing this config will modify the host's keyring!
# Use a syncURL that is unlikely to conflict with the host
# or any other D-Bus test.
config[""]["syncURL"] = "http://no-such-domain.foobar"
config[""]["autoSync"] = "1"
config[""]["autoSyncDelay"] = "0"
config[""]["autoSyncInterval"] = "10s"