示例#1
0
 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)
示例#2
0
 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)
示例#3
0
 def test_generate_url_should_succeed(self):
     gravtr = Gravtr(email=self.email)
     assert self.gravtr_url, gravtr.generate()
示例#4
0
 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)
示例#5
0
 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)
示例#6
0
 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)