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
21
from nova.utils import parse_mailmap, str_dict_replace
24
class ProjectTestCase(test.TrialTestCase):
25
def test_authors_up_to_date(self):
26
if os.path.exists('../.bzr'):
27
log_cmd = subprocess.Popen(["bzr", "log", "-n0"],
28
stdout=subprocess.PIPE)
29
changelog = log_cmd.communicate()[0]
30
mailmap = parse_mailmap('../.mailmap')
33
for l in changelog.split('\n'):
35
if (l.startswith('author:') or l.startswith('committer:')
36
and not l == 'committer: Tarmac'):
37
email = l.split(' ')[-1]
38
contributors.add(str_dict_replace(email, mailmap))
40
authors_file = open('../Authors', 'r').read()
43
for contributor in contributors:
44
if not contributor in authors_file:
45
missing.add(contributor)
47
self.assertTrue(len(missing) == 0,
48
'%r not listed in Authors' % missing)