def test_it_removes_merge_commits(self): raw_git_log = "\n".join(( u"abcde}Some message}Sherlock Holmes}[email protected]", u"fghij}Merge commit}John Watson}[email protected]", )) changelog = tokenize_git_log(raw_git_log) assert len(changelog) == 1 assert changelog[0]['author_email'] == u"*****@*****.**"
def test_it_gets_all_contributors(self): raw_git_log = "\n".join(( u"abcde}Some message}Sherlock Holmes}[email protected]", u"fghij}Other message}John Watson}[email protected]", )) changelog = tokenize_git_log(raw_git_log) contributors = get_contributors(changelog) assert len(contributors) == 2 assert (set(c['email'] for c in contributors) == set(['*****@*****.**', '*****@*****.**']))
def test_it_merges_contributors_by_gravatar(self): raw_git_log = "\n".join(( u"abcde}Some message}Sherlock Holmes}[email protected]", u"fghij}Other message}John Watson}[email protected]", u"klmno}New message}Sherlock Holmes}[email protected]", u"pqrst}Final message}John Watson}[email protected]", )) changelog = tokenize_git_log(raw_git_log) contributors = get_contributors(changelog) assert len(contributors) == 2 assert (set(c['email'] for c in contributors) == set(['*****@*****.**', '*****@*****.**']))
def test_it_tokenizes_log_correctly(self): raw_git_log = "\n".join(( u"abcde}Some message}Sherlock Holmes}[email protected]", u"fghij}Other message}John Watson}[email protected]", )) changelog = tokenize_git_log(raw_git_log) first = changelog[0] assert len(changelog) == 2 assert first['hash'] == u"abcde" assert first['message'] == u"Some message" assert first['author_name'] == u"Sherlock Holmes" assert first['author_email'] == u"*****@*****.**" assert 'author_gravatar' in first
def test_it_gets_tasks_from_manoderecha(self): raw_git_log = "\n".join(( u"abcde}Some message}Sherlock Holmes}[email protected]", u"fghij}(md:123) Other message}John Watson}[email protected]", u"klmno}New message}Sherlock Holmes}[email protected]", u"pqrst}(md:456) Final message}John Watson}[email protected]", )) changelog = tokenize_git_log(raw_git_log) changelog = parse_labels(changelog) md = mock.Mock() md.get_tasks.return_value = [{'isActive': True}] tasks = get_tasks(changelog, md) assert tasks == md.get_tasks.return_value args, kwargs = md.get_tasks.call_args task_ids = args[0] assert set(['123', '456']) == set(task_ids)