def testPostUpdateAndDeleteSubscription(self):
    self.cal_client.ProgrammaticLogin()

    subscription_id = 'c4o4i7m2lbamc4k26sc2vokh5g%40group.calendar.google.com'
    subscription_url = '%s%s' % (
        'http://www.google.com/calendar/feeds/default/allcalendars/full/', 
        subscription_id)

    # Subscribe to Google Doodles calendar        
    calendar = gdata.calendar.CalendarListEntry()
    calendar.id = atom.Id(text=subscription_id)
    returned_calendar = self.cal_client.InsertCalendarSubscription(calendar)
    self.assertEquals(subscription_url, returned_calendar.id.text)
    self.assertEquals('Google Doodles', returned_calendar.title.text)

    # Update subscription
    calendar_to_update = self.cal_client.GetCalendarListEntry(subscription_url)
    self.assertEquals('Google Doodles', calendar_to_update.title.text) 
    self.assertEquals('true', calendar_to_update.selected.value) 
    calendar_to_update.selected.value = 'false'
    self.assertEquals('false', calendar_to_update.selected.value) 
    updated_calendar = self.cal_client.UpdateCalendar(calendar_to_update)
    self.assertEquals('false', updated_calendar.selected.value) 
    
    # Delete subscription
    response = self.cal_client.DeleteCalendarEntry(
        returned_calendar.GetEditLink().href)
    self.assertEquals(True, response)
Test posting a new subscription, updating it, deleting it
dataset/ETHPy150Open kuri65536/python-for-android/python-build/python-libs/gdata/tests/gdata_tests/calendar/service_test.py/CalendarServiceUnitTest.testPostUpdateAndDeleteSubscription