def testHtmlPageToAndFromString(self): self.method = webmastertools.VerificationMethod() self.method.type = 'htmlpage' self.method.in_use = 'false' self.method.text = '456456-google.html' self.assert_(self.method.type == 'htmlpage') self.assert_(self.method.in_use == 'false') self.assert_(self.method.text == '456456-google.html') self.assert_(self.method.meta is None) new_method = webmastertools.VerificationMethodFromString( self.method.ToString()) self.assert_(self.method.type == new_method.type) self.assert_(self.method.in_use == new_method.in_use) self.assert_(self.method.text == new_method.text) self.assert_(self.method.meta is None)
def testMetaTagToAndFromString(self): self.method = webmastertools.VerificationMethod() self.method.type = 'metatag' self.method.in_use = 'false' self.assert_(self.method.type == 'metatag') self.assert_(self.method.in_use == 'false') self.method.meta = webmastertools.VerificationMethodMeta( name='verify-vf1', content='a2Ai') self.assert_(self.method.meta.name == 'verify-vf1') self.assert_(self.method.meta.content == 'a2Ai') new_method = webmastertools.VerificationMethodFromString( self.method.ToString()) self.assert_(self.method.type == new_method.type) self.assert_(self.method.in_use == new_method.in_use) self.assert_(self.method.meta.name == new_method.meta.name) self.assert_(self.method.meta.content == new_method.meta.content)