2 from __future__
import absolute_import
, division
, unicode_literals
5 from cola
import gravatar
6 from cola
.compat
import ustr
9 class GravatarTestCase(unittest
.TestCase
):
11 def test_url_for_email_(self
):
12 email
= 'email@example.com'
13 expect
= (r
'https://gravatar.com/avatar/'
14 r
'5658ffccee7f0ebfda2b226238b1eb6e'
16 r
'&d=https%3A%2F%2Fgit-cola.github.io'
17 r
'%2Fimages%2Fgit-64x64.jpg')
18 actual
= gravatar
.Gravatar
.url_for_email(email
, 64)
19 self
.assertEqual(expect
, actual
)
20 self
.assertTrue(isinstance(actual
, ustr
))
23 if __name__
== '__main__':