Changeset - b6c702202f82
[Not reviewed]
default
0 1 0
Mads Kiilerich - 10 years ago 2016-02-15 19:29:26
madski@unity3d.com
tests: add test for author_email handling of invalid author strings

This shows that author_email can return invalid email addresses.
1 file changed with 3 insertions and 0 deletions:
0 comments (0 inline, 0 general)
kallithea/tests/vcs/test_utils.py
Show inline comments
 
# -*- coding: utf-8 -*-
 

	
 
import os
 
import mock
 
import time
 
import shutil
 
import tempfile
 
@@ -201,12 +202,14 @@ class TestAuthorExtractors(unittest.Test
 
                  ('<justemail@example.com>',
 
                   ('', 'justemail@example.com')),
 
                  ('justname',
 
                   ('justname', '')),
 
                  ('Mr Double Name withemail@example.com ',
 
                   ('Mr Double Name', 'withemail@example.com')),
 
                  (u'John Doe <джондо à éẋàṁṗłê.ç°ḿ>',
 
                   (u'John Doe <\u0434\u0436\u043e\u043d\u0434\u043e \xe0 \xe9\u1e8b\xe0\u1e41\u1e57\u0142\xea.\xe7\xb0\u1e3f>', '\xd0\xb4\xd0\xb6\xd0\xbe\xd0\xbd\xd0\xb4\xd0\xbe \xc3\xa0 \xc3\xa9\xe1\xba\x8b\xc3\xa0\xe1\xb9\x81\xe1\xb9\x97\xc5\x82\xc3\xaa.\xc3\xa7\xc2\xb0\xe1\xb8\xbf')),
 
                  ]
 

	
 
    def test_author_email(self):
 

	
 
        for test_str, result in self.TEST_AUTHORS:
 
            self.assertEqual(result[1], author_email(test_str))
0 comments (0 inline, 0 general)