def test_get_head_adsense(): match = ADSENSE_REGEX.findall( "<p>[adsense:client=ca-pub-123456,slot=123456,type_ad=head]</p>")[0] assert match[1] == "ca-pub-123456" assert match[2] == "123456" assert match[3] == "head"
def test_get_adsense_error(): match = ADSENSE_REGEX.findall( "<p>[adsense:client=ca-pub-123456,slot=123456]</p>") assert len(match) == 0