[folks] eds: rework tests so that they don't depend on relative URIs



commit 0ff740a9026592f723a6b219906a4823f2ec04fa
Author: Raul Gutierrez Segales <rgs collabora co uk>
Date:   Wed Sep 21 22:07:27 2011 +0100

    eds: rework tests so that they don't depend on relative URIs
    
    Previously, tests were build around the assumption that each
    Edsf.PersonaStore had an id == ESource.relative_uri. That
    stopped being true (because you'll get swallowed by a black
    hole in pwithnall's garden if you use relative URIs).
    
    Helps: https://bugzilla.gnome.org/show_bug.cgi?id=659732

 tests/eds/add-contacts-stress-test.vala |    3 ++-
 tests/eds/add-persona.vala              |    3 ++-
 tests/eds/change-primary-store.vala     |    6 ++++--
 tests/eds/remove-persona.vala           |    4 +++-
 4 files changed, 11 insertions(+), 5 deletions(-)
---
diff --git a/tests/eds/add-contacts-stress-test.vala b/tests/eds/add-contacts-stress-test.vala
index a0078c0..264860f 100644
--- a/tests/eds/add-contacts-stress-test.vala
+++ b/tests/eds/add-contacts-stress-test.vala
@@ -101,7 +101,8 @@ public class AddContactsStressTestTests : Folks.TestCase
           foreach (var backend in store.enabled_backends.values)
             {
               this._pstore =
-                (Edsf.PersonaStore) backend.persona_stores.get ("local://test");
+                (Edsf.PersonaStore) backend.persona_stores.get (
+                    this._eds_backend.address_book_uid);
               if (this._pstore != null)
                 break;
             }
diff --git a/tests/eds/add-persona.vala b/tests/eds/add-persona.vala
index 0531dee..b2271dc 100644
--- a/tests/eds/add-persona.vala
+++ b/tests/eds/add-persona.vala
@@ -134,7 +134,8 @@ public class AddPersonaTests : Folks.TestCase
           foreach (var backend in store.enabled_backends.values)
             {
               this._pstore =
-                (Edsf.PersonaStore) backend.persona_stores.get ("local://test");
+                (Edsf.PersonaStore) backend.persona_stores.get (
+                    this._eds_backend.address_book_uid);
               if (this._pstore != null)
                 break;
             }
diff --git a/tests/eds/change-primary-store.vala b/tests/eds/change-primary-store.vala
index 44f7d37..54f1d7d 100644
--- a/tests/eds/change-primary-store.vala
+++ b/tests/eds/change-primary-store.vala
@@ -88,8 +88,10 @@ public class ChangePrimaryStoreTests : Folks.TestCase
         {
           yield this._aggregator.prepare ();
 
-          this._pstore1 = this._get_persona_store (store, "system");
-          this._pstore2 = this._get_persona_store (store, "other");
+          this._pstore1 = this._get_persona_store (store,
+              this._eds_backend.address_book_uid);
+          this._pstore2 = this._get_persona_store (store,
+              this._eds_backend_other.address_book_uid);
 
           assert (this._pstore1 != null);
           assert (this._pstore2 != null);
diff --git a/tests/eds/remove-persona.vala b/tests/eds/remove-persona.vala
index 3865e8d..9883e6b 100644
--- a/tests/eds/remove-persona.vala
+++ b/tests/eds/remove-persona.vala
@@ -91,7 +91,9 @@ public class RemovePersonaTests : Folks.TestCase
           this._pstore = null;
           foreach (var backend in store.enabled_backends.values)
             {
-              this._pstore = backend.persona_stores.get ("local://test");
+              this._pstore =
+                (Edsf.PersonaStore) backend.persona_stores.get (
+                    this._eds_backend.address_book_uid);
               if (this._pstore != null)
                 break;
             }



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