[folks] eds test: create a new address book for each test to avoid inheriting state



commit 01263791d2f827dd7f07cd3451441a26f01b36b2
Author: Travis Reitter <travis reitter collabora co uk>
Date:   Sat Dec 29 18:43:22 2012 -0800

    eds test: create a new address book for each test to avoid inheriting state
    
    This fixes a bug where the web services linking test would fail if it ran
    after the im address linking test.

 tests/eds/link-personas.vala |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/tests/eds/link-personas.vala b/tests/eds/link-personas.vala
index b0d1e42..bdee12c 100644
--- a/tests/eds/link-personas.vala
+++ b/tests/eds/link-personas.vala
@@ -48,6 +48,7 @@ public class LinkPersonasTests : Folks.TestCase
   private HashSet<Persona> _personas;
   private Gee.HashMap<string, string> _linking_props;
   private LinkingMethod _linking_method;
+  private int _test_num = -1;
 
   public LinkPersonasTests ()
     {
@@ -66,7 +67,11 @@ public class LinkPersonasTests : Folks.TestCase
   public override void set_up ()
     {
       this._eds_backend = new EdsTest.Backend ();
-      this._eds_backend.set_up ();
+
+      /* Create a new backend (by name) each set up to guarantee we don't
+       * inherit state from the last test */
+      this._test_num++;
+      this._eds_backend.set_up (false, @"test$_test_num");
 
       /* We configure eds as the primary store */
       var config_val = "eds:%s".printf (this._eds_backend.address_book_uid);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]