def test_default_prefix(self): u = UrlParser('http://i.verbify.com/r/verbifydev') u.switch_subdomain_by_extension() self.assertEquals('http://www.verbify.com/r/verbifydev', u.unparse()) u = UrlParser('http://i.verbify.com/r/verbifydev') u.switch_subdomain_by_extension('does-not-exist') self.assertEquals('http://www.verbify.com/r/verbifydev', u.unparse())
def test_normal_urls(self): u = UrlParser('http://www.verbify.com/r/verbifydev') u.switch_subdomain_by_extension('compact') result = u.unparse() self.assertEquals('http://i.verbify.com/r/verbifydev', result) u = UrlParser(result) u.switch_subdomain_by_extension('mobile') result = u.unparse() self.assertEquals('http://simple.verbify.com/r/verbifydev', result)