From c282315f0b533c3790494767d1da23aaa9d360b9 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Sat, 6 Jul 2019 10:41:42 +0800 Subject: Fix regex to support empty email addresses i.e. 'name <>' Fixes #833 --- git/test/test_util.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'git/test/test_util.py') diff --git a/git/test/test_util.py b/git/test/test_util.py index 9c993205..3f5e4abe 100644 --- a/git/test/test_util.py +++ b/git/test/test_util.py @@ -212,6 +212,11 @@ class TestUtils(TestBase): self.assertIsInstance(Actor.author(cr), Actor) # END assure config reader is handled + def test_actor_from_string(self): + self.assertEqual(Actor._from_string("name"), Actor("name", None)) + self.assertEqual(Actor._from_string("name <>"), Actor("name", "")) + self.assertEqual(Actor._from_string("name last another "), Actor("name last another", "some-very-long-email@example.com")) + @ddt.data(('name', ''), ('name', 'prefix_')) def test_iterable_list(self, case): name, prefix = case -- cgit v1.2.1