<s> __author__ = '<STR_LIT>' <EOL> import unittest <EOL> try : <EOL> from xml . etree import ElementTree <EOL> except ImportError : <EOL> from elementtree import ElementTree <EOL> import gdata <EOL> from gdata import test_data <EOL> import gdata . webmastertools as webmastertools <EOL> class IndexedTest ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . indexed = webmastertools . Indexed ( ) <EOL> def testToAndFromString ( self ) : <EOL> self . indexed . text = '<STR_LIT:true>' <EOL> self . assert_ ( self . indexed . text == '<STR_LIT:true>' ) <EOL> new_indexed = webmastertools . IndexedFromString ( self . indexed . ToString ( ) ) <EOL> self . assert_ ( self . indexed . text == new_indexed . text ) <EOL> class CrawledTest ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . crawled = webmastertools . Crawled ( ) <EOL> def testToAndFromString ( self ) : <EOL> self . crawled . text = '<STR_LIT:true>' <EOL> self . assert_ ( self . crawled . text == '<STR_LIT:true>' ) <EOL> new_crawled = webmastertools . CrawledFromString ( self . crawled . ToString ( ) ) <EOL> self . assert_ ( self . crawled . text == new_crawled . text ) <EOL> class GeoLocationTest ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . geolocation = webmastertools . GeoLocation ( ) <EOL> def testToAndFromString ( self ) : <EOL> self . geolocation . text = '<STR_LIT>' <EOL> self . assert_ ( self . geolocation . text == '<STR_LIT>' ) <EOL> new_geolocation = webmastertools . GeoLocationFromString ( <EOL> self . geolocation . ToString ( ) ) <EOL> self . assert_ ( self . geolocation . text == new_geolocation . text ) <EOL> class PreferredDomainTest ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . preferred_domain = webmastertools . PreferredDomain ( ) <EOL> def testToAndFromString ( self ) : <EOL> self . preferred_domain . text = '<STR_LIT:none>' <EOL> self . assert_ ( self . preferred_domain . text == '<STR_LIT:none>' ) <EOL> new_preferred_domain = webmastertools . PreferredDomainFromString ( <EOL> self . preferred_domain . ToString ( ) ) <EOL> self . assert_ ( self . preferred_domain . text == new_preferred_domain . text ) <EOL> class CrawlRateTest ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . crawl_rate = webmastertools . CrawlRate ( ) <EOL> def testToAndFromString ( self ) : <EOL> self . crawl_rate . text = '<STR_LIT>' <EOL> self . assert_ ( self . crawl_rate . text == '<STR_LIT>' ) <EOL> new_crawl_rate = webmastertools . CrawlRateFromString ( <EOL> self . crawl_rate . ToString ( ) ) <EOL> self . assert_ ( self . crawl_rate . text == new_crawl_rate . text ) <EOL> class EnhancedImageSearchTest ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . enhanced_image_search = webmastertools . EnhancedImageSearch ( ) <EOL> def testToAndFromString ( self ) : <EOL> self . enhanced_image_search . text = '<STR_LIT:true>' <EOL> self . assert_ ( self . enhanced_image_search . text == '<STR_LIT:true>' ) <EOL> new_enhanced_image_search = webmastertools . EnhancedImageSearchFromString ( <EOL> self . enhanced_image_search . ToString ( ) ) <EOL> self . assert_ ( self . enhanced_image_search . text == <EOL> new_enhanced_image_search . text ) <EOL> class VerifiedTest ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . verified = webmastertools . Verified ( ) <EOL> def testToAndFromString ( self ) : <EOL> self . verified . text = '<STR_LIT:true>' <EOL> self . assert_ ( self . verified . text == '<STR_LIT:true>' ) <EOL> new_verified = webmastertools . VerifiedFromString ( self . verified . ToString ( ) ) <EOL> self . assert_ ( self . verified . text == new_verified . text ) <EOL> class VerificationMethodMetaTest ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . meta = webmastertools . VerificationMethodMeta ( ) <EOL> def testToAndFromString ( self ) : <EOL> self . meta . name = '<STR_LIT>' <EOL> self . meta . content = '<STR_LIT>' <EOL> self . assert_ ( self . meta . name == '<STR_LIT>' ) <EOL> self . assert_ ( self . meta . content == '<STR_LIT>' ) <EOL> new_meta = webmastertools . VerificationMethodMetaFromString ( <EOL> self . meta . ToString ( ) ) <EOL> self . assert_ ( self . meta . name == new_meta . name ) <EOL> self . assert_ ( self . meta . content == new_meta . content ) <EOL> class VerificationMethodTest ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> pass <EOL> def testMetaTagToAndFromString ( self ) : <EOL> self . method = webmastertools . VerificationMethod ( ) <EOL> self . method . type = '<STR_LIT>' <EOL> self . method . in_use = '<STR_LIT:false>' <EOL> self . assert_ ( self . method . type == '<STR_LIT>' ) <EOL> self . assert_ ( self . method . in_use == '<STR_LIT:false>' ) <EOL> self . method . meta = webmastertools . VerificationMethodMeta ( name = '<STR_LIT>' , <EOL> content = '<STR_LIT>' ) <EOL> self . assert_ ( self . method . meta . name == '<STR_LIT>' ) <EOL> self . assert_ ( self . method . meta . content == '<STR_LIT>' ) <EOL> new_method = webmastertools . VerificationMethodFromString ( <EOL> self . method . ToString ( ) ) <EOL> self . assert_ ( self . method . type == new_method . type ) <EOL> self . assert_ ( self . method . in_use == new_method . in_use ) <EOL> self . assert_ ( self . method . meta . name == new_method . meta . name ) <EOL> self . assert_ ( self . method . meta . content == new_method . meta . content ) <EOL> def testHtmlPageToAndFromString ( self ) : <EOL> self . method = webmastertools . VerificationMethod ( ) <EOL> self . method . type = '<STR_LIT>' <EOL> self . method . in_use = '<STR_LIT:false>' <EOL> self . method . text = '<STR_LIT>' <EOL> self . assert_ ( self . method . type == '<STR_LIT>' ) <EOL> self . assert_ ( self . method . in_use == '<STR_LIT:false>' ) <EOL> self . assert_ ( self . method . text == '<STR_LIT>' ) <EOL> self . assert_ ( self . method . meta is None ) <EOL> new_method = webmastertools . VerificationMethodFromString ( <EOL> self . method . ToString ( ) ) <EOL> self . assert_ ( self . method . type == new_method . type ) <EOL> self . assert_ ( self . method . in_use == new_method . in_use ) <EOL> self . assert_ ( self . method . text == new_method . text ) <EOL> self . assert_ ( self . method . meta is None ) <EOL> def testConvertActualData ( self ) : <EOL> feed = webmastertools . SitesFeedFromString ( test_data . SITES_FEED ) <EOL> self . assert_ ( len ( feed . entry [ <NUM_LIT:0> ] . verification_method ) == <NUM_LIT:2> ) <EOL> check = <NUM_LIT:0> <EOL> for method in feed . entry [ <NUM_LIT:0> ] . verification_method : <EOL> self . assert_ ( isinstance ( method , webmastertools . VerificationMethod ) ) <EOL> if method . type == '<STR_LIT>' : <EOL> self . assert_ ( method . in_use == '<STR_LIT:false>' ) <EOL> self . assert_ ( method . text is None ) <EOL> self . assert_ ( method . meta . name == '<STR_LIT>' ) <EOL> self . assert_ ( method . meta . content == '<STR_LIT>' ) <EOL> check = check | <NUM_LIT:1> <EOL> elif method . type == '<STR_LIT>' : <EOL> self . assert_ ( method . in_use == '<STR_LIT:false>' ) <EOL> self . assert_ ( method . text == '<STR_LIT>' ) <EOL> check = check | <NUM_LIT:2> <EOL> else : <EOL> self . fail ( '<STR_LIT>' % method . type ) <EOL> self . assert_ ( check == <NUM_LIT:2> ** <NUM_LIT:2> - <NUM_LIT:1> , <EOL> '<STR_LIT>' ) <EOL> class MarkupLanguageTest ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . markup_language = webmastertools . MarkupLanguage ( ) <EOL> def testToAndFromString ( self ) : <EOL> self . markup_language . text = '<STR_LIT>' <EOL> self . assert_ ( self . markup_language . text == '<STR_LIT>' ) <EOL> new_markup_language = webmastertools . MarkupLanguageFromString ( <EOL> self . markup_language . ToString ( ) ) <EOL> self . assert_ ( self . markup_language . text == new_markup_language . text ) <EOL> class SitemapMobileTest ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . sitemap_mobile = webmastertools . SitemapMobile ( ) <EOL> def testToAndFromString ( self ) : <EOL> self . sitemap_mobile . markup_language . append ( webmastertools . MarkupLanguage ( <EOL> text = '<STR_LIT>' ) ) <EOL> self . assert_ ( self . sitemap_mobile . text is None ) <EOL> self . assert_ ( self . sitemap_mobile . markup_language [ <NUM_LIT:0> ] . text == '<STR_LIT>' ) <EOL> new_sitemap_mobile = webmastertools . SitemapMobileFromString ( <EOL> self . sitemap_mobile . ToString ( ) ) <EOL> self . assert_ ( new_sitemap_mobile . text is None ) <EOL> self . assert_ ( self . sitemap_mobile . markup_language [ <NUM_LIT:0> ] . text == <EOL> new_sitemap_mobile . markup_language [ <NUM_LIT:0> ] . text ) <EOL> def testConvertActualData ( self ) : <EOL> feed = webmastertools . SitemapsFeedFromString ( test_data . SITEMAPS_FEED ) <EOL> self . assert_ ( feed . sitemap_mobile . text . strip ( ) == '<STR_LIT>' ) <EOL> self . assert_ ( len ( feed . sitemap_mobile . markup_language ) == <NUM_LIT:2> ) <EOL> check = <NUM_LIT:0> <EOL> for markup_language in feed . sitemap_mobile . markup_language : <EOL> self . assert_ ( isinstance ( markup_language , webmastertools . MarkupLanguage ) ) <EOL> if markup_language . text == "<STR_LIT>" : <EOL> check = check | <NUM_LIT:1> <EOL> elif markup_language . text == "<STR_LIT>" : <EOL> check = check | <NUM_LIT:2> <EOL> else : <EOL> self . fail ( '<STR_LIT>' % markup_language . text ) <EOL> self . assert_ ( check == <NUM_LIT:2> ** <NUM_LIT:2> - <NUM_LIT:1> , "<STR_LIT>" ) <EOL> class SitemapMobileMarkupLanguageTest ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . sitemap_mobile_markup_language = webmastertools . SitemapMobileMarkupLanguage ( ) <EOL> def testToAndFromString ( self ) : <EOL> self . sitemap_mobile_markup_language . text = '<STR_LIT>' <EOL> self . assert_ ( self . sitemap_mobile_markup_language . text == '<STR_LIT>' ) <EOL> new_sitemap_mobile_markup_language = webmastertools . SitemapMobileMarkupLanguageFromString ( <EOL> self . sitemap_mobile_markup_language . ToString ( ) ) <EOL> self . assert_ ( self . sitemap_mobile_markup_language . text == new_sitemap_mobile_markup_language . text ) <EOL> class PublicationLabelTest ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . publication_label = webmastertools . PublicationLabel ( ) <EOL> def testToAndFromString ( self ) : <EOL> self . publication_label . text = '<STR_LIT>' <EOL> self . assert_ ( self . publication_label . text == '<STR_LIT>' ) <EOL> new_publication_label = webmastertools . PublicationLabelFromString ( <EOL> self . publication_label . ToString ( ) ) <EOL> self . assert_ ( self . publication_label . text == new_publication_label . text ) <EOL> class SitemapNewsTest ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . sitemap_news = webmastertools . SitemapNews ( ) <EOL> def testToAndFromString ( self ) : <EOL> self . sitemap_news . publication_label . append ( webmastertools . PublicationLabel ( <EOL> text = '<STR_LIT>' ) ) <EOL> self . assert_ ( self . sitemap_news . text is None ) <EOL> self . assert_ ( self . sitemap_news . publication_label [ <NUM_LIT:0> ] . text == '<STR_LIT>' ) <EOL> new_sitemap_news = webmastertools . SitemapNewsFromString ( <EOL> self . sitemap_news . ToString ( ) ) <EOL> self . assert_ ( new_sitemap_news . text is None ) <EOL> self . assert_ ( self . sitemap_news . publication_label [ <NUM_LIT:0> ] . text == <EOL> new_sitemap_news . publication_label [ <NUM_LIT:0> ] . text ) <EOL> def testConvertActualData ( self ) : <EOL> feed = webmastertools . SitemapsFeedFromString ( test_data . SITEMAPS_FEED ) <EOL> self . assert_ ( len ( feed . sitemap_news . publication_label ) == <NUM_LIT:3> ) <EOL> check = <NUM_LIT:0> <EOL> for publication_label in feed . sitemap_news . publication_label : <EOL> if publication_label . text == "<STR_LIT>" : <EOL> check = check | <NUM_LIT:1> <EOL> elif publication_label . text == "<STR_LIT>" : <EOL> check = check | <NUM_LIT:2> <EOL> elif publication_label . text == "<STR_LIT>" : <EOL> check = check | <NUM_LIT:4> <EOL> else : <EOL> self . fail ( '<STR_LIT>' % markup_language . text ) <EOL> self . assert_ ( check == <NUM_LIT:2> ** <NUM_LIT:3> - <NUM_LIT:1> , <EOL> '<STR_LIT>' ) <EOL> class SitemapNewsPublicationLabelTest ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . sitemap_news_publication_label = webmastertools . SitemapNewsPublicationLabel ( ) <EOL> def testToAndFromString ( self ) : <EOL> self . sitemap_news_publication_label . text = '<STR_LIT>' <EOL> self . assert_ ( self . sitemap_news_publication_label . text == '<STR_LIT>' ) <EOL> new_sitemap_news_publication_label = webmastertools . SitemapNewsPublicationLabelFromString ( <EOL> self . sitemap_news_publication_label . ToString ( ) ) <EOL> self . assert_ ( self . sitemap_news_publication_label . text == new_sitemap_news_publication_label . text ) <EOL> class SitemapLastDownloadedTest ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . sitemap_last_downloaded = webmastertools . SitemapLastDownloaded ( ) <EOL> def testToAndFromString ( self ) : <EOL> self . sitemap_last_downloaded . text = '<STR_LIT>' <EOL> self . assert_ ( self . sitemap_last_downloaded . text == '<STR_LIT>' ) <EOL> new_sitemap_last_downloaded = webmastertools . SitemapLastDownloadedFromString ( <EOL> self . sitemap_last_downloaded . ToString ( ) ) <EOL> self . assert_ ( self . sitemap_last_downloaded . text == new_sitemap_last_downloaded . text ) <EOL> class SitemapTypeTest ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . sitemap_type = webmastertools . SitemapType ( ) <EOL> def testToAndFromString ( self ) : <EOL> self . sitemap_type . text = '<STR_LIT>' <EOL> self . assert_ ( self . sitemap_type . text == '<STR_LIT>' ) <EOL> new_sitemap_type = webmastertools . SitemapTypeFromString ( <EOL> self . sitemap_type . ToString ( ) ) <EOL> self . assert_ ( self . sitemap_type . text == new_sitemap_type . text ) <EOL> class SitemapStatusTest ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . sitemap_status = webmastertools . SitemapStatus ( ) <EOL> def testToAndFromString ( self ) : <EOL> self . sitemap_status . text = '<STR_LIT>' <EOL> self . assert_ ( self . sitemap_status . text == '<STR_LIT>' ) <EOL> new_sitemap_status = webmastertools . SitemapStatusFromString ( <EOL> self . sitemap_status . ToString ( ) ) <EOL> self . assert_ ( self . sitemap_status . text == new_sitemap_status . text ) <EOL> class SitemapUrlCountTest ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . sitemap_url_count = webmastertools . SitemapUrlCount ( ) <EOL> def testToAndFromString ( self ) : <EOL> self . sitemap_url_count . text = '<STR_LIT:0>' <EOL> self . assert_ ( self . sitemap_url_count . text == '<STR_LIT:0>' ) <EOL> new_sitemap_url_count = webmastertools . SitemapUrlCountFromString ( <EOL> self . sitemap_url_count . ToString ( ) ) <EOL> self . assert_ ( self . sitemap_url_count . text == new_sitemap_url_count . text ) <EOL> class SitesEntryTest ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> pass <EOL> def testToAndFromString ( self ) : <EOL> entry = webmastertools . SitesEntry ( <EOL> indexed = webmastertools . Indexed ( text = '<STR_LIT:true>' ) , <EOL> crawled = webmastertools . Crawled ( text = '<STR_LIT>' ) , <EOL> geolocation = webmastertools . GeoLocation ( text = '<STR_LIT>' ) , <EOL> preferred_domain = webmastertools . PreferredDomain ( text = '<STR_LIT:none>' ) , <EOL> crawl_rate = webmastertools . CrawlRate ( text = '<STR_LIT>' ) , <EOL> enhanced_image_search = webmastertools . EnhancedImageSearch ( text = '<STR_LIT:true>' ) , <EOL> verified = webmastertools . Verified ( text = '<STR_LIT:false>' ) , <EOL> ) <EOL> self . assert_ ( entry . indexed . text == '<STR_LIT:true>' ) <EOL> self . assert_ ( entry . crawled . text == '<STR_LIT>' ) <EOL> self . assert_ ( entry . geolocation . text == '<STR_LIT>' ) <EOL> self . assert_ ( entry . preferred_domain . text == '<STR_LIT:none>' ) <EOL> self . assert_ ( entry . crawl_rate . text == '<STR_LIT>' ) <EOL> self . assert_ ( entry . enhanced_image_search . text == '<STR_LIT:true>' ) <EOL> self . assert_ ( entry . verified . text == '<STR_LIT:false>' ) <EOL> new_entry = webmastertools . SitesEntryFromString ( entry . ToString ( ) ) <EOL> self . assert_ ( new_entry . indexed . text == '<STR_LIT:true>' ) <EOL> self . assert_ ( new_entry . crawled . text == '<STR_LIT>' ) <EOL> self . assert_ ( new_entry . geolocation . text == '<STR_LIT>' ) <EOL> self . assert_ ( new_entry . preferred_domain . text == '<STR_LIT:none>' ) <EOL> self . assert_ ( new_entry . crawl_rate . text == '<STR_LIT>' ) <EOL> self . assert_ ( new_entry . enhanced_image_search . text == '<STR_LIT:true>' ) <EOL> self . assert_ ( new_entry . verified . text == '<STR_LIT:false>' ) <EOL> def testConvertActualData ( self ) : <EOL> feed = webmastertools . SitesFeedFromString ( test_data . SITES_FEED ) <EOL> self . assert_ ( len ( feed . entry ) == <NUM_LIT:1> ) <EOL> entry = feed . entry [ <NUM_LIT:0> ] <EOL> self . assert_ ( isinstance ( entry , webmastertools . SitesEntry ) ) <EOL> self . assert_ ( entry . indexed . text == '<STR_LIT:true>' ) <EOL> self . assert_ ( entry . crawled . text == '<STR_LIT>' ) <EOL> self . assert_ ( entry . geolocation . text == '<STR_LIT>' ) <EOL> self . assert_ ( entry . preferred_domain . text == '<STR_LIT:none>' ) <EOL> self . assert_ ( entry . crawl_rate . text == '<STR_LIT>' ) <EOL> self . assert_ ( entry . enhanced_image_search . text == '<STR_LIT:true>' ) <EOL> self . assert_ ( entry . verified . text == '<STR_LIT:false>' ) <EOL> class SitesFeedTest ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . feed = gdata . webmastertools . SitesFeedFromString ( test_data . SITES_FEED ) <EOL> def testToAndFromString ( self ) : <EOL> self . assert_ ( len ( self . feed . entry ) == <NUM_LIT:1> ) <EOL> for entry in self . feed . entry : <EOL> self . assert_ ( isinstance ( entry , webmastertools . SitesEntry ) ) <EOL> new_feed = webmastertools . SitesFeedFromString ( self . feed . ToString ( ) ) <EOL> self . assert_ ( len ( new_feed . entry ) == <NUM_LIT:1> ) <EOL> for entry in new_feed . entry : <EOL> self . assert_ ( isinstance ( entry , webmastertools . SitesEntry ) ) <EOL> class SitemapsEntryTest ( unittest . TestCase ) : <EOL> def testRegularToAndFromString ( self ) : <EOL> entry = webmastertools . SitemapsEntry ( <EOL> sitemap_type = webmastertools . SitemapType ( text = '<STR_LIT>' ) , <EOL> sitemap_status = webmastertools . SitemapStatus ( text = '<STR_LIT>' ) , <EOL> sitemap_last_downloaded = webmastertools . SitemapLastDownloaded ( <EOL> text = '<STR_LIT>' ) , <EOL> sitemap_url_count = webmastertools . SitemapUrlCount ( text = '<STR_LIT>' ) , <EOL> ) <EOL> self . assert_ ( entry . sitemap_type . text == '<STR_LIT>' ) <EOL> self . assert_ ( entry . sitemap_status . text == '<STR_LIT>' ) <EOL> self . assert_ ( entry . sitemap_last_downloaded . text == '<STR_LIT>' ) <EOL> self . assert_ ( entry . sitemap_url_count . text == '<STR_LIT>' ) <EOL> new_entry = webmastertools . SitemapsEntryFromString ( entry . ToString ( ) ) <EOL> self . assert_ ( new_entry . sitemap_type . text == '<STR_LIT>' ) <EOL> self . assert_ ( new_entry . sitemap_status . text == '<STR_LIT>' ) <EOL> self . assert_ ( new_entry . sitemap_last_downloaded . text == '<STR_LIT>' ) <EOL> self . assert_ ( new_entry . sitemap_url_count . text == '<STR_LIT>' ) <EOL> def testConvertActualData ( self ) : <EOL> feed = gdata . webmastertools . SitemapsFeedFromString ( test_data . SITEMAPS_FEED ) <EOL> self . assert_ ( len ( feed . entry ) == <NUM_LIT:3> ) <EOL> for entry in feed . entry : <EOL> self . assert_ ( entry , webmastertools . SitemapsEntry ) <EOL> self . assert_ ( entry . sitemap_status , webmastertools . SitemapStatus ) <EOL> self . assert_ ( entry . sitemap_last_downloaded , <EOL> webmastertools . SitemapLastDownloaded ) <EOL> self . assert_ ( entry . sitemap_url_count , webmastertools . SitemapUrlCount ) <EOL> self . assert_ ( entry . sitemap_status . text == '<STR_LIT>' ) <EOL> self . assert_ ( entry . sitemap_last_downloaded . text == '<STR_LIT>' ) <EOL> self . assert_ ( entry . sitemap_url_count . text == '<STR_LIT>' ) <EOL> if entry . id . text == '<STR_LIT>' : <EOL> self . assert_ ( entry . sitemap_type , webmastertools . SitemapType ) <EOL> self . assert_ ( entry . sitemap_type . text == '<STR_LIT>' ) <EOL> self . assert_ ( entry . sitemap_mobile_markup_language is None ) <EOL> self . assert_ ( entry . sitemap_news_publication_label is None ) <EOL> elif entry . id . text == '<STR_LIT>' : <EOL> self . assert_ ( entry . sitemap_mobile_markup_language , <EOL> webmastertools . SitemapMobileMarkupLanguage ) <EOL> self . assert_ ( entry . sitemap_mobile_markup_language . text == '<STR_LIT>' ) <EOL> self . assert_ ( entry . sitemap_type is None ) <EOL> self . assert_ ( entry . sitemap_news_publication_label is None ) <EOL> elif entry . id . text == '<STR_LIT>' : <EOL> self . assert_ ( entry . sitemap_news_publication_label , <EOL> webmastertools . SitemapNewsPublicationLabel ) <EOL> self . assert_ ( entry . sitemap_news_publication_label . text == '<STR_LIT>' ) <EOL> self . assert_ ( entry . sitemap_type is None ) <EOL> self . assert_ ( entry . sitemap_mobile_markup_language is None ) <EOL> class SitemapsFeedTest ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . feed = gdata . webmastertools . SitemapsFeedFromString ( <EOL> test_data . SITEMAPS_FEED ) <EOL> def testToAndFromString ( self ) : <EOL> self . assert_ ( len ( self . feed . entry ) == <NUM_LIT:3> ) <EOL> for entry in self . feed . entry : <EOL> self . assert_ ( isinstance ( entry , webmastertools . SitemapsEntry ) ) <EOL> new_feed = webmastertools . SitemapsFeedFromString ( self . feed . ToString ( ) ) <EOL> self . assert_ ( len ( new_feed . entry ) == <NUM_LIT:3> ) <EOL> for entry in new_feed . entry : <EOL> self . assert_ ( isinstance ( entry , webmastertools . SitemapsEntry ) ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
