From: Philip Withnall Date: Thu, 16 Sep 2010 16:46:32 +0000 (+0100) Subject: Disable unused backends in the tests. X-Git-Tag: FOLKS_0_3_2~52 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=145d13ad7320affbdc5f8c201c75251f8cd6c6ac;p=platform%2Fupstream%2Ffolks.git Disable unused backends in the tests. Helps bgo#629862. --- diff --git a/tests/key-file/individual-retrieval.vala b/tests/key-file/individual-retrieval.vala index 1776366..873b226 100644 --- a/tests/key-file/individual-retrieval.vala +++ b/tests/key-file/individual-retrieval.vala @@ -6,6 +6,7 @@ public class IndividualRetrievalTests : Folks.TestCase { private KfTest.Backend kf_backend; private MainLoop main_loop; + private static const string STORE_FILE_PATH = "folks-key-file-store.ini"; public IndividualRetrievalTests () { @@ -20,10 +21,29 @@ public class IndividualRetrievalTests : Folks.TestCase public override void set_up () { this.main_loop = new GLib.MainLoop (null, false); + + FileUtils.remove (Path.build_filename (Environment.get_tmp_dir (), + this.STORE_FILE_PATH, null)); + + /* Use a temporary key file for the BackendStore */ + Environment.set_variable ("FOLKS_BACKEND_STORE_KEY_FILE_PATH", + Path.build_filename (Environment.get_tmp_dir (), + this.STORE_FILE_PATH, null), true); + + /* Disable the Telepathy backend so it doesn't interfere with the tests */ + BackendStore store = BackendStore.dup (); + store.prepare.begin ((o, r) => + { + store.prepare.end (r); + store.disable_backend.begin ("telepathy"); + }); } public override void tear_down () { + FileUtils.remove (Path.build_filename (Environment.get_tmp_dir (), + this.STORE_FILE_PATH, null)); + Timeout.add_seconds (5, () => { this.main_loop.quit (); diff --git a/tests/telepathy/individual-retrieval.vala b/tests/telepathy/individual-retrieval.vala index 9dcae66..8b7ecd7 100644 --- a/tests/telepathy/individual-retrieval.vala +++ b/tests/telepathy/individual-retrieval.vala @@ -44,6 +44,14 @@ public class IndividualRetrievalTests : Folks.TestCase store.disable_backend.begin ("key-file"); }); + /* Disable the key-file backend so it doesn't interfere with the tests */ + BackendStore store = BackendStore.dup (); + store.prepare.begin ((o, r) => + { + store.prepare.end (r); + store.disable_backend.begin ("key-file"); + }); + this.tp_backend.set_up (); }