Hello community, here is the log from the commit of package python-gdata for openSUSE:Factory checked in at Mon Aug 9 02:24:34 CEST 2010. -------- --- python-gdata/python-gdata.changes 2010-03-25 12:50:16.000000000 +0100 +++ /mounts/work_src_done/STABLE/python-gdata/python-gdata.changes 2010-08-06 17:46:16.000000000 +0200 @@ -1,0 +2,14 @@ +Fri Aug 6 17:43:07 CEST 2010 - vuntz@opensuse.org + +- Update to version 2.0.10: + + Add check for liveness of proxy in live tests. Also add in + upload-diffs.py to make using codereview.appspot.com easier. + + Add the ResourceEmail attribute to CalendarResourceEntry + + Adding new single page methods to apps.groups.service. + + Cleanup in service GetWithRetries. + + Adding much more test coverage for calendar_resource.client. + + Fixing Calendar Resource get_resource to use correct feed URI + generator. + + Adds support for Blogger Pages. + +------------------------------------------------------------------- calling whatdependson for head-i586 Old: ---- gdata-2.0.9.tar.bz2 New: ---- gdata-2.0.10.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-gdata.spec ++++++ --- /var/tmp/diff_new_pack.4M1OQG/_old 2010-08-09 02:24:12.000000000 +0200 +++ /var/tmp/diff_new_pack.4M1OQG/_new 2010-08-09 02:24:12.000000000 +0200 @@ -1,5 +1,5 @@ # -# spec file for package python-gdata (Version 2.0.9) +# spec file for package python-gdata (Version 2.0.10) # # Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany. # @@ -22,7 +22,7 @@ BuildRequires: python-devel python-setuptools License: Apache Software License .. Group: Development/Libraries/Python -Version: 2.0.9 +Version: 2.0.10 Release: 1 Summary: Python library to access data through Google Data APIs Url: http://code.google.com/p/gdata-python-client ++++++ gdata-2.0.9.tar.bz2 -> gdata-2.0.10.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gdata-2.0.9/PKG-INFO new/gdata-2.0.10/PKG-INFO --- old/gdata-2.0.9/PKG-INFO 2010-03-05 23:38:00.000000000 +0100 +++ new/gdata-2.0.10/PKG-INFO 2010-05-12 21:30:43.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.0 Name: gdata -Version: 2.0.9 +Version: 2.0.10 Summary: Python client library for Google data APIs Home-page: http://code.google.com/p/gdata-python-client/ Author: Jeffrey Scudder diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gdata-2.0.9/RELEASE_NOTES.txt new/gdata-2.0.10/RELEASE_NOTES.txt --- old/gdata-2.0.9/RELEASE_NOTES.txt 2010-03-05 23:36:25.000000000 +0100 +++ new/gdata-2.0.10/RELEASE_NOTES.txt 2010-05-12 21:21:59.000000000 +0200 @@ -1,3 +1,14 @@ +=== 2.0.10 === +May 12, 2010 (revision 980) + + - Add check for liveness of proxy in live tests. Also add in upload-diffs.py to make using codereview.appspot.com easier. + - Patch from Alexandre Vivien adds the ResourceEmail attribute to CalendarResourceEntry + - Adding new single page methods to apps.groups.service. Thanks Jeremy Selier! + - Cleanup in service GetWithRetries. Thanks Will Charles! + - Adding much more test coverage for calendar_resource.client. + - Fixing Calendar Resource get_resource to use correct feed URI generator. Thanks to Alexandre Vivien for reporting. + - Adds support for Blogger Pages. Thanks Wiktor Gworek! + === 2.0.9 === March 5, 2010 (revision 964) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gdata-2.0.9/setup.py new/gdata-2.0.10/setup.py --- old/gdata-2.0.9/setup.py 2010-03-05 23:17:29.000000000 +0100 +++ new/gdata-2.0.10/setup.py 2010-05-12 21:23:08.000000000 +0200 @@ -25,7 +25,7 @@ setup( name='gdata', - version='2.0.9', + version='2.0.10', description='Python client library for Google data APIs', long_description = """\ The Google data Python client library makes it easy to interact with diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gdata-2.0.9/src/atom/client.py new/gdata-2.0.10/src/atom/client.py --- old/gdata-2.0.9/src/atom/client.py 2010-03-05 23:18:13.000000000 +0100 +++ new/gdata-2.0.10/src/atom/client.py 2010-05-12 21:24:41.000000000 +0200 @@ -36,7 +36,7 @@ class AtomPubClient(object): host = None auth_token = None - ssl = False # Whether to force all requests over https + ssl = True # Whether to force all requests over https def __init__(self, http_client=None, host=None, auth_token=None, source=None, **kwargs): @@ -173,9 +173,9 @@ # Set the user agent header for logging purposes. if self.source: - http_request.headers['User-Agent'] = '%s gdata-py/2.0.9' % self.source + http_request.headers['User-Agent'] = '%s gdata-py/2.0.10' % self.source else: - http_request.headers['User-Agent'] = 'gdata-py/2.0.9' + http_request.headers['User-Agent'] = 'gdata-py/2.0.10' return http_request diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gdata-2.0.9/src/atom/http_interface.py new/gdata-2.0.10/src/atom/http_interface.py --- old/gdata-2.0.9/src/atom/http_interface.py 2010-03-05 23:17:58.000000000 +0100 +++ new/gdata-2.0.10/src/atom/http_interface.py 2010-05-12 21:23:31.000000000 +0200 @@ -36,7 +36,7 @@ import StringIO -USER_AGENT = '%s GData-Python/2.0.9' +USER_AGENT = '%s GData-Python/2.0.10' class Error(Exception): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gdata-2.0.9/src/atom/service.py new/gdata-2.0.10/src/atom/service.py --- old/gdata-2.0.9/src/atom/service.py 2010-02-05 01:40:58.000000000 +0100 +++ new/gdata-2.0.10/src/atom/service.py 2010-05-07 19:17:14.000000000 +0200 @@ -63,7 +63,7 @@ # Default values for members port = 80 - ssl = False + ssl = True # Set the current_token to force the AtomService to use this token # instead of searching for an appropriate token in the token_store. current_token = None diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gdata-2.0.9/src/gdata/apps/groups/service.py new/gdata-2.0.10/src/gdata/apps/groups/service.py --- old/gdata-2.0.9/src/gdata/apps/groups/service.py 2010-01-04 23:14:02.000000000 +0100 +++ new/gdata-2.0.10/src/gdata/apps/groups/service.py 2010-05-05 02:57:12.000000000 +0200 @@ -163,6 +163,21 @@ uri = self._ServiceUrl('group', True, '', '', '') return self._GetPropertiesList(uri) + def RetrievePageOfGroups(self, start_group=None): + """Retrieve one page of groups in the domain. + + Args: + start_group: The key to continue for pagination through all groups. + + Returns: + A feed object containing the result of the retrieve operation. + """ + uri = self._ServiceUrl('group', True, '', '', '') + if start_group is not None: + uri += "?start="+start_group + property_feed = self._GetPropertyFeed(uri) + return property_feed + def RetrieveGroups(self, member_id, direct_only=False): """Retrieve all groups that belong to the given member_id. @@ -243,6 +258,29 @@ uri = self._ServiceUrl('member', True, group_id, '', '', suspended_users=suspended_users) return self._GetPropertiesList(uri) + + def RetrievePageOfMembers(self, group_id, suspended_users=False, start=None): + """Retrieve one page of members of a given group. + + Args: + group_id: The ID of the group (e.g. us-sales). + suspended_users: A boolean; should we include any suspended users in + the membership list returned? + start: The key to continue for pagination through all members. + + Returns: + A feed object containing the result of the retrieve operation. + """ + + uri = self._ServiceUrl('member', True, group_id, '', '', + suspended_users=suspended_users) + if start is not None: + if suspended_users: + uri += "&start="+start + else: + uri += "?start="+start + property_feed = self._GetPropertyFeed(uri) + return property_feed def RemoveMemberFromGroup(self, member_id, group_id): """Remove the given member from the given group. @@ -312,7 +350,29 @@ uri = self._ServiceUrl('owner', True, group_id, '', '', suspended_users=suspended_users) return self._GetPropertiesList(uri) + + def RetrievePageOfOwners(self, group_id, suspended_users=False, start=None): + """Retrieve one page of owners of the given group. + + Args: + group_id: The ID of the group (e.g. us-sales). + suspended_users: A boolean; should we include any suspended users in + the ownership list returned? + start: The key to continue for pagination through all owners. + Returns: + A feed object containing the result of the retrieve operation. + """ + uri = self._ServiceUrl('owner', True, group_id, '', '', + suspended_users=suspended_users) + if start is not None: + if suspended_users: + uri += "&start="+start + else: + uri += "?start="+start + property_feed = self._GetPropertyFeed(uri) + return property_feed + def RemoveOwnerFromGroup(self, owner_email, group_id): """Remove the given owner from the given group. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gdata-2.0.9/src/gdata/blogger/client.py new/gdata-2.0.10/src/gdata/blogger/client.py --- old/gdata-2.0.9/src/gdata/blogger/client.py 2010-02-19 01:15:41.000000000 +0100 +++ new/gdata-2.0.10/src/gdata/blogger/client.py 2010-04-16 21:45:16.000000000 +0200 @@ -36,6 +36,8 @@ BLOGS_URL = 'http://www.blogger.com/feeds/%s/blogs' # Takes a blog ID. BLOG_POST_URL = 'http://www.blogger.com/feeds/%s/posts/default' +# Takes a blog ID. +BLOG_PAGE_URL = 'http://www.blogger.com/feeds/%s/pages/default' # Takes a blog ID and post ID. BLOG_POST_COMMENTS_URL = 'http://www.blogger.com/feeds/%s/%s/comments/default' # Takes a blog ID. @@ -64,6 +66,14 @@ GetPosts = get_posts + def get_pages(self, blog_id, auth_token=None, + desired_class=gdata.blogger.data.BlogPageFeed, query=None, + **kwargs): + return self.get_feed(BLOG_PAGE_URL % blog_id, auth_token=auth_token, + desired_class=desired_class, query=query, **kwargs) + + GetPages = get_pages + def get_post_comments(self, blog_id, post_id, auth_token=None, desired_class=gdata.blogger.data.CommentFeed, query=None, **kwargs): @@ -102,6 +112,17 @@ AddPost = add_post + def add_page(self, blog_id, title, body, draft=False, auth_token=None, + title_type='text', body_type='html', **kwargs): + new_entry = gdata.blogger.data.BlogPage( + title=atom.data.Title(text=title, type=title_type), + content=atom.data.Content(text=body, type=body_type)) + if draft: + new_entry.control = atom.data.Control(draft=atom.data.Draft(text='yes')) + return self.post(new_entry, BLOG_PAGE_URL % blog_id, auth_token=auth_token, **kwargs) + + AddPage = add_page + def add_comment(self, blog_id, post_id, body, auth_token=None, title_type='text', body_type='html', **kwargs): new_entry = gdata.blogger.data.Comment( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gdata-2.0.9/src/gdata/blogger/data.py new/gdata-2.0.10/src/gdata/blogger/data.py --- old/gdata-2.0.9/src/gdata/blogger/data.py 2009-10-30 19:25:26.000000000 +0100 +++ new/gdata-2.0.10/src/gdata/blogger/data.py 2010-04-16 21:45:16.000000000 +0200 @@ -34,6 +34,8 @@ BLOG_ID2_PATTERN = re.compile('tag:blogger.com,1999:user-(\d+)\.blog-(\d+)') POST_ID_PATTERN = re.compile( '(tag:blogger.com,1999:blog-)(\w*)(.post-)(\w*)') +PAGE_ID_PATTERN = re.compile( + '(tag:blogger.com,1999:blog-)(\w*)(.page-)(\w*)') COMMENT_ID_PATTERN = re.compile('.*-(\w*)$') @@ -118,6 +120,25 @@ entry = [BlogPost] +class BlogPage(BloggerEntry): + """Represents a single page on a blog.""" + + def get_page_id(self): + """Extracts the pageID string from entry's Atom id. + + Returns: A string of digits which identify this post within the blog. + """ + if self.id.text: + return PAGE_ID_PATTERN.match(self.id.text).group(4) + return None + + GetPageId = get_page_id + + +class BlogPageFeed(gdata.data.GDFeed): + entry = [BlogPage] + + class InReplyTo(atom.core.XmlElement): _qname = THR_TEMPLATE % 'in-reply-to' href = 'href' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gdata-2.0.9/src/gdata/calendar_resource/client.py new/gdata-2.0.10/src/gdata/calendar_resource/client.py --- old/gdata-2.0.9/src/gdata/calendar_resource/client.py 2010-02-18 20:40:18.000000000 +0100 +++ new/gdata-2.0.10/src/gdata/calendar_resource/client.py 2010-04-27 22:44:53.000000000 +0200 @@ -119,7 +119,7 @@ """ if uri is None: - uri = self.MakeResourceUri(resource_id) + uri = self.MakeResourceFeedUri(resource_id) return self.get_entry(uri, desired_class=gdata.calendar_resource.data.CalendarResourceEntry, **kwargs) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gdata-2.0.9/src/gdata/calendar_resource/data.py new/gdata-2.0.10/src/gdata/calendar_resource/data.py --- old/gdata-2.0.9/src/gdata/calendar_resource/data.py 2010-01-26 19:29:05.000000000 +0100 +++ new/gdata-2.0.10/src/gdata/calendar_resource/data.py 2010-05-09 04:41:12.000000000 +0200 @@ -40,6 +40,8 @@ RESOURCE_DESCRIPTION_NAME = 'resourceDescription' # The apps:property name of the resourceType property RESOURCE_TYPE_NAME = 'resourceType' +# The apps:property name of the resourceEmail property +RESOURCE_EMAIL_NAME = 'resourceEmail' class AppsProperty(atom.core.XmlElement): @@ -171,6 +173,17 @@ resource_type = pyproperty(GetResourceType, SetResourceType) + def GetResourceEmail(self): + """Get the email of this Calendar Resource object. + + Returns: + The email of this Calendar Resource object as a string or None. + """ + + return self._GetProperty(RESOURCE_EMAIL_NAME) + + resource_email = pyproperty(GetResourceEmail) + def __init__(self, resource_id=None, resource_common_name=None, resource_description=None, resource_type=None, *args, **kwargs): """Constructs a new CalendarResourceEntry object with the given arguments. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gdata-2.0.9/src/gdata/core.py new/gdata-2.0.10/src/gdata/core.py --- old/gdata-2.0.9/src/gdata/core.py 2010-02-10 01:29:40.000000000 +0100 +++ new/gdata-2.0.10/src/gdata/core.py 2010-04-16 21:45:16.000000000 +0200 @@ -78,6 +78,10 @@ return _convert_to_jsonc(simplejson.loads(json_string)) +def parse_json_file(json_file): + return _convert_to_jsonc(simplejson.load(json_file)) + + def jsonc_to_string(jsonc_obj): """Converts a Jsonc object into a string of JSON-C.""" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gdata-2.0.9/src/gdata/data.py new/gdata-2.0.10/src/gdata/data.py --- old/gdata-2.0.9/src/gdata/data.py 2010-02-26 22:34:20.000000000 +0100 +++ new/gdata-2.0.10/src/gdata/data.py 2010-04-16 21:45:16.000000000 +0200 @@ -314,7 +314,7 @@ GetId = get_id def is_media(self): - if self.find_media_edit_link(): + if self.find_edit_media_link(): return True return False diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gdata-2.0.9/src/gdata/service.py new/gdata-2.0.10/src/gdata/service.py --- old/gdata-2.0.9/src/gdata/service.py 2010-02-09 21:11:05.000000000 +0100 +++ new/gdata-2.0.10/src/gdata/service.py 2010-05-05 02:57:12.000000000 +0200 @@ -952,19 +952,19 @@ def GetWithRetries(self, uri, extra_headers=None, redirects_remaining=4, encoding='UTF-8', converter=None, num_retries=DEFAULT_NUM_RETRIES, delay=DEFAULT_DELAY, backoff=DEFAULT_BACKOFF, logger=None): - """This is a wrapper method for Get with retring capability. + """This is a wrapper method for Get with retrying capability. - To avoid various errors while retrieving bulk entities by retring + To avoid various errors while retrieving bulk entities by retrying specified times. Note this method relies on the time module and so may not be usable by default in Python2.2. Args: - num_retries: integer The retry count. - delay: integer The initial delay for retring. - backoff: integer how much the delay should lengthen after each failure. - logger: an object which has a debug(str) method to receive logging + num_retries: Integer; the retry count. + delay: Integer; the initial delay for retrying. + backoff: Integer; how much the delay should lengthen after each failure. + logger: An object which has a debug(str) method to receive logging messages. Recommended that you pass in the logging module. Raises: ValueError if any of the parameters has an invalid value. @@ -989,25 +989,30 @@ while mtries > 0: if mtries != num_retries: if logger: - logger.debug("Retrying...") + logger.debug("Retrying: %s" % uri) try: rv = self.Get(uri, extra_headers=extra_headers, redirects_remaining=redirects_remaining, encoding=encoding, converter=converter) - except (SystemExit, RequestError): - # Allow these errors + except SystemExit: + # Allow this error raise + except RequestError, e: + # Error 500 is 'internal server error' and warrants a retry + # Error 503 is 'service unavailable' and warrants a retry + if e[0]['status'] not in [500, 503]: + raise e + # Else, fall through to the retry code... except Exception, e: if logger: logger.debug(e) - mtries -= 1 - time.sleep(mdelay) - mdelay *= backoff + # Fall through to the retry code... else: # This is the right path. - if logger: - logger.debug("Succeeeded...") return rv + mtries -= 1 + time.sleep(mdelay) + mdelay *= backoff raise RanOutOfTries('Ran out of tries.') # CRUD operations diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gdata-2.0.9/tests/gdata_tests/blogger/live_client_test.py new/gdata-2.0.10/tests/gdata_tests/blogger/live_client_test.py --- old/gdata-2.0.9/tests/gdata_tests/blogger/live_client_test.py 2009-10-09 02:30:05.000000000 +0200 +++ new/gdata-2.0.10/tests/gdata_tests/blogger/live_client_test.py 2010-04-16 21:45:12.000000000 +0200 @@ -106,6 +106,45 @@ self.client.delete(updated.find_edit_link()) + def test_create_draft_page(self): + if not conf.options.get_value('runlive') == 'true': + return + conf.configure_cache(self.client, 'test_create_draft_page') + + # List all pages on the blog. + pages_before = self.client.get_pages(conf.options.get_value('blogid')) + + # Add a draft page to blog. + created = self.client.add_page(conf.options.get_value('blogid'), + 'draft page from BloggerClientTest', + 'draft content', + draft=True) + + self.assertEqual(created.title.text, 'draft page from BloggerClientTest') + self.assertEqual(created.content.text, 'draft content') + self.assert_(created.control is not None) + self.assert_(created.control.draft is not None) + self.assertEqual(created.control.draft.text, 'yes') + self.assertEqual(str(int(created.get_page_id())), created.get_page_id()) + + # List all pages after adding one. + pages_after = self.client.get_pages(conf.options.get_value('blogid')) + self.assertEqual(len(pages_before.entry) + 1, len(pages_after.entry)) + + # Publish page. + created.control.draft.text = 'no' + updated = self.client.update(created) + + if updated.control is not None and updated.control.draft is not None: + self.assertNotEqual(updated.control.draft.text, 'yes') + + # Delete test page. + self.client.delete(updated.find_edit_link()) + pages_after = self.client.get_pages(conf.options.get_value('blogid')) + + self.assertEqual(len(pages_before.entry), len(pages_after.entry)) + + def suite(): return conf.build_suite([BloggerClientTest]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gdata-2.0.9/tests/gdata_tests/calendar_resource/live_client_test.py new/gdata-2.0.10/tests/gdata_tests/calendar_resource/live_client_test.py --- old/gdata-2.0.9/tests/gdata_tests/calendar_resource/live_client_test.py 2010-02-26 22:49:54.000000000 +0100 +++ new/gdata-2.0.10/tests/gdata_tests/calendar_resource/live_client_test.py 2010-04-27 22:44:53.000000000 +0200 @@ -36,7 +36,8 @@ class CalendarResourceClientTest(unittest.TestCase): def setUp(self): - self.client = None + self.client = gdata.calendar_resource.client.CalendarResourceClient( + domain='example.com') if conf.options.get_value('runlive') == 'true': self.client = gdata.calendar_resource.client.CalendarResourceClient( domain=conf.options.get_value('appsdomain')) @@ -48,7 +49,35 @@ def tearDown(self): conf.close_client(self.client) - def testCreateUpdateDelete(self): + def testClientConfiguration(self): + self.assertEqual('apps-apis.google.com', self.client.host) + self.assertEqual('2.0', self.client.api_version) + self.assertEqual('apps', self.client.auth_service) + self.assertEqual( + ('http://www.google.com/a/feeds/', + 'https://www.google.com/a/feeds/', + 'http://apps-apis.google.com/a/feeds/', + 'https://apps-apis.google.com/a/feeds/'), self.client.auth_scopes) + if conf.options.get_value('runlive') == 'true': + self.assertEqual(self.client.domain, conf.options.get_value('appsdomain')) + else: + self.assertEqual(self.client.domain, 'example.com') + + def testMakeResourceFeedUri(self): + self.assertEqual('/a/feeds/calendar/resource/2.0/%s/' % self.client.domain, + self.client.MakeResourceFeedUri()) + self.assertEqual('/a/feeds/calendar/resource/2.0/%s/CR-NYC-14-12-BR' + % self.client.domain, + self.client.MakeResourceFeedUri(resource_id='CR-NYC-14-12-BR')) + self.assertEqual('/a/feeds/calendar/resource/2.0/%s/?test=1' + % self.client.domain, + self.client.MakeResourceFeedUri(params={'test': 1})) + self.assertEqual('/a/feeds/calendar/resource/2.0/%s/CR-NYC-14-12-BR?test=1' + % self.client.domain, + self.client.MakeResourceFeedUri(resource_id='CR-NYC-14-12-BR', + params={'test': 1})) + + def testCreateRetrieveUpdateDelete(self): if not conf.options.get_value('runlive') == 'true': return @@ -69,6 +98,16 @@ 'Boardroom')) self.assertEqual(new_entry.resource_type, 'CR') + fetched_entry = self.client.get_resource(resource_id='CR-NYC-14-12-BR') + self.assert_(isinstance(fetched_entry, + gdata.calendar_resource.data.CalendarResourceEntry)) + self.assertEqual(fetched_entry.resource_id, 'CR-NYC-14-12-BR') + self.assertEqual(fetched_entry.resource_common_name, 'Boardroom') + self.assertEqual(fetched_entry.resource_description, + ('This conference room is in New York City, building 14, floor 12, ' + 'Boardroom')) + self.assertEqual(fetched_entry.resource_type, 'CR') + new_entry.resource_id = 'CR-MTV-14-12-BR' new_entry.resource_common_name = 'Executive Boardroom' new_entry.resource_description = 'This conference room is in Mountain View' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gdata-2.0.9/tests/gdata_tests/live_client_test.py new/gdata-2.0.10/tests/gdata_tests/live_client_test.py --- old/gdata-2.0.9/tests/gdata_tests/live_client_test.py 2010-02-12 03:21:56.000000000 +0100 +++ new/gdata-2.0.10/tests/gdata_tests/live_client_test.py 2010-05-10 22:23:51.000000000 +0200 @@ -30,6 +30,7 @@ import atom.mock_http_core import atom.core import gdata.data +import gdata.core # TODO: switch to using v2 atom data once it is available. import atom import gdata.test_config as conf @@ -265,9 +266,28 @@ self.client.delete(edited) def test_crud_over_https_proxy(self): - os.environ['https_proxy'] = '98.192.125.23' - # Perform the CRUD test above, this time over a proxy. - self.test_version_two_client() + import urllib + PROXY_ADDR = '98.192.125.23' + try: + response = urllib.urlopen('http://' + PROXY_ADDR) + except IOError: + return + # Only bother running the test if the proxy is up + if response.getcode() == 200: + os.environ['https_proxy'] = PROXY_ADDR + # Perform the CRUD test above, this time over a proxy. + self.test_version_two_client() + +class JsoncRequestTest(unittest.TestCase): + + def setUp(self): + self.client = gdata.client.GDClient() + + def test_get_jsonc(self): + jsonc = self.client.get_feed( + 'http://gdata.youtube.com/feeds/api/videos?q=surfing&v=2&alt=jsonc', + converter=gdata.core.parse_json_file) + self.assertTrue(len(jsonc.data.items) > 0) # Utility methods. @@ -297,7 +317,8 @@ def suite(): return conf.build_suite([BloggerTest, ContactsTest, - VersionTwoClientContactsTest]) + VersionTwoClientContactsTest, + JsoncRequestTest]) if __name__ == '__main__': ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org