eds: rework tests so that they don't depend on relative URIs
authorRaul Gutierrez Segales <rgs@collabora.co.uk>
Wed, 21 Sep 2011 21:07:27 +0000 (22:07 +0100)
committerRaul Gutierrez Segales <rgs@collabora.co.uk>
Wed, 21 Sep 2011 22:36:43 +0000 (23:36 +0100)
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
tests/eds/add-persona.vala
tests/eds/change-primary-store.vala
tests/eds/remove-persona.vala

index a0078c0..264860f 100644 (file)
@@ -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;
             }
index 0531dee..b2271dc 100644 (file)
@@ -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;
             }
index 44f7d37..54f1d7d 100644 (file)
@@ -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);
index 3865e8d..9883e6b 100644 (file)
@@ -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;
             }