]> git.0d.be Git - empathy.git/commitdiff
load the chatrooms sample XML file
authorXavier Claessens <xclaesse@src.gnome.org>
Mon, 13 Oct 2008 07:54:15 +0000 (07:54 +0000)
committerXavier Claessens <xclaesse@src.gnome.org>
Mon, 13 Oct 2008 07:54:15 +0000 (07:54 +0000)
svn path=/trunk/; revision=1552

tests/check-empathy-chatroom-manager.c

index fbeb9bae1682ebf73bd281437bd592766c36f0b7..84ac322334fc760a784b61b1cded7bdb39a89e77 100644 (file)
 START_TEST (test_empathy_chatroom_manager_new)
 {
   EmpathyChatroomManager *mgr;
+  gchar *cmd;
   gchar *file;
+  McProfile *profile;
+  McAccount *account;
+
+  profile = mc_profile_lookup ("test");
+  account = mc_account_create (profile);
 
   copy_xml_file (CHATROOM_SAMPLE, CHATROOM_FILE);
-  file = get_xml_file (CHATROOM_FILE);
+
+  file = get_user_xml_file (CHATROOM_FILE);
+  /* change the chatrooms XML file to use the account we just created */
+  cmd = g_strdup_printf ("sed -i 's/CHANGE_ME/%s/' %s",
+      mc_account_get_unique_name (account), file);
+  system (cmd);
+  g_free (cmd);
+
   mgr = empathy_chatroom_manager_new (file);
 
+  fail_if (empathy_chatroom_manager_get_count (mgr, account) != 2);
+
   g_free (file);
   g_object_unref (mgr);
+  g_object_unref (profile);
+  remove_account_from_gconf (account);
+  mc_account_delete (account);
+  g_object_unref (account);
 }
 END_TEST