def test_generate_url_with_force_default_should_succeed(self): default_image = 'http://example.com/image.jpg' gravtr = Gravtr(email=self.email).generate(default=default_image, force_default=True) assert re.search( r"(\?|\&)d\=http\%3A\%2F\%2Fexample\.com\%2Fimage\.jpg", gravtr) assert re.search(r"(\?|\&)f\=y", gravtr)
def test_generate_url_with_specified_size_should_succeed(self): gravtr = Gravtr(email=self.email) assert self.gravtr_url + '?' + str(200), gravtr.generate(size=200)
def test_generate_url_should_succeed(self): gravtr = Gravtr(email=self.email) assert self.gravtr_url, gravtr.generate()
def test_generate_url_with_rating_type_should_succeed(self): gravtr = Gravtr(email=self.email).generate( typed=True, rating_type=Gravtr.ratingType.X) assert re.search(r"(\?|\&)r\=x", gravtr)
def test_generate_url_with_type_should_succeed(self): gravtr = Gravtr(email=self.email).generate(typed=True, size=200) assert re.search(r"\.jpg", gravtr)
def test_generate_url_with_specified_size_should_succeed(self): gravtr = Gravtr(email=self.email).generate(size=200) assert re.search(r"(\?|\&)s\=200", gravtr)