empathy r1552 - trunk/tests



Author: xclaesse
Date: Mon Oct 13 07:54:15 2008
New Revision: 1552
URL: http://svn.gnome.org/viewvc/empathy?rev=1552&view=rev

Log:
load the chatrooms sample XML file

Modified:
   trunk/tests/check-empathy-chatroom-manager.c

Modified: trunk/tests/check-empathy-chatroom-manager.c
==============================================================================
--- trunk/tests/check-empathy-chatroom-manager.c	(original)
+++ trunk/tests/check-empathy-chatroom-manager.c	Mon Oct 13 07:54:15 2008
@@ -15,14 +15,33 @@
 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
 



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