[libgdata] [youtube] Fix test suite



commit c7e34540485457acbe1db545ea042ce9c0f796d4
Author: Philip Withnall <philip tecnocode co uk>
Date:   Mon Sep 21 08:17:04 2009 +0100

    [youtube] Fix test suite
    
    Includes a change to the upload URI for videos to upload them to the
    default (i.e. logged in) user, rather than having us worry about whether
    to send a Google Account username or YouTube username.

 gdata/services/youtube/gdata-youtube-service.c |    6 ++----
 gdata/tests/youtube.c                          |    8 ++++++--
 2 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/gdata/services/youtube/gdata-youtube-service.c b/gdata/services/youtube/gdata-youtube-service.c
index b76d08d..df1ca37 100644
--- a/gdata/services/youtube/gdata-youtube-service.c
+++ b/gdata/services/youtube/gdata-youtube-service.c
@@ -770,7 +770,7 @@ gdata_youtube_service_upload_video (GDataYouTubeService *self, GDataYouTubeVideo
 
 	GDataServiceClass *klass;
 	SoupMessage *message;
-	gchar *entry_xml, *upload_uri, *second_chunk_header, *upload_data, *video_contents, *i;
+	gchar *entry_xml, *second_chunk_header, *upload_data, *video_contents, *i;
 	const gchar *first_chunk_header, *footer;
 	guint status;
 	GFileInfo *video_file_info;
@@ -791,9 +791,7 @@ gdata_youtube_service_upload_video (GDataYouTubeService *self, GDataYouTubeVideo
 		return NULL;
 	}
 
-	upload_uri = g_strdup_printf ("http://uploads.gdata.youtube.com/feeds/api/users/%s/uploads";, gdata_service_get_username (GDATA_SERVICE (self)));
-	message = soup_message_new (SOUP_METHOD_POST, upload_uri);
-	g_free (upload_uri);
+	message = soup_message_new (SOUP_METHOD_POST, "http://uploads.gdata.youtube.com/feeds/api/users/default/uploads";);
 
 	/* Make sure subclasses set their headers */
 	klass = GDATA_SERVICE_GET_CLASS (self);
diff --git a/gdata/tests/youtube.c b/gdata/tests/youtube.c
index 703acf2..c741f8e 100644
--- a/gdata/tests/youtube.c
+++ b/gdata/tests/youtube.c
@@ -276,7 +276,7 @@ test_upload_simple (GDataService *service)
 	gdata_entry_set_title (GDATA_ENTRY (video), "Bad Wedding Toast");
 	gdata_youtube_video_set_title (video, "Bad Wedding Toast");
 	gdata_youtube_video_set_description (video, "I gave a bad toast at my friend's wedding.");
-	category = gdata_media_category_new ("People", NULL, "http://gdata.youtube.com/schemas/2007/categories.cat";);
+	category = gdata_media_category_new ("People", "http://gdata.youtube.com/schemas/2007/categories.cat";, NULL);
 	gdata_youtube_video_set_category (video, category);
 	g_object_unref (category);
 	gdata_youtube_video_set_keywords (video, "toast, wedding");
@@ -287,7 +287,8 @@ test_upload_simple (GDataService *service)
 			 "<entry xmlns='http://www.w3.org/2005/Atom' "
 				"xmlns:media='http://search.yahoo.com/mrss/' "
 				"xmlns:gd='http://schemas.google.com/g/2005' "
-				"xmlns:yt='http://gdata.youtube.com/schemas/2007'>"
+				"xmlns:yt='http://gdata.youtube.com/schemas/2007' "
+				"xmlns:app='http://www.w3.org/2007/app'>"
 			 	"<title type='text'>Bad Wedding Toast</title>"
 			 	"<media:group>"
 			 		"<media:category scheme='http://gdata.youtube.com/schemas/2007/categories.cat'>People</media:category>"
@@ -295,6 +296,9 @@ test_upload_simple (GDataService *service)
 			 		"<media:description type='plain'>I gave a bad toast at my friend&apos;s wedding.</media:description>"
 			 		"<media:keywords>toast, wedding</media:keywords>"
 			 	"</media:group>"
+				"<app:control>"
+					"<app:draft>no</app:draft>"
+				"</app:control>"
 			 "</entry>");
 	g_free (xml);
 



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