1
# vim: tabstop=4 shiftwidth=4 softtabstop=4
3
# Copyright 2010 OpenStack LLC
5
# Licensed under the Apache License, Version 2.0 (the "License"); you may
6
# not use this file except in compliance with the License. You may obtain
7
# a copy of the License at
9
# http://www.apache.org/licenses/LICENSE-2.0
11
# Unless required by applicable law or agreed to in writing, software
12
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
# License for the specific language governing permissions and limitations
20
from nova.utils import parse_mailmap, str_dict_replace
23
class ProjectTestCase(test.TrialTestCase):
24
def test_authors_up_to_date(self):
25
if os.path.exists('../.bzr'):
28
mailmap = parse_mailmap('../.mailmap')
30
import bzrlib.workingtree
31
tree = bzrlib.workingtree.WorkingTree.open('..')
33
parents = tree.get_parent_ids()
34
g = tree.branch.repository.get_graph()
36
rev_ids = [r for r, _ in g.iter_ancestry(parents)
38
revs = tree.branch.repository.get_revisions(rev_ids)
40
for author in r.get_apparent_authors():
41
email = author.split(' ')[-1]
42
contributors.add(str_dict_replace(email, mailmap))
44
authors_file = open('../Authors', 'r').read()
47
for contributor in contributors:
48
if not contributor in authors_file:
49
missing.add(contributor)
51
self.assertTrue(len(missing) == 0,
52
'%r not listed in Authors' % missing)