diff options
| author | Soren Hansen <soren@linux2go.dk> | 2011-03-15 15:54:55 +0000 |
|---|---|---|
| committer | Tarmac <> | 2011-03-15 15:54:55 +0000 |
| commit | 24142b1198da8560840356afee1896ace2d23d5c (patch) | |
| tree | dd346ef5dffa03082542e3bf0c461fdd01b76c72 /nova | |
| parent | 213491128098c7838a1bdfc9c4a55264380e67cd (diff) | |
| parent | 67a8d635af0a64ad220b163c00b96eadf7daf93f (diff) | |
Make Authors check account for tests being run with different os.getcwd() depending on how they're run. Add missing people to Authors.
Diffstat (limited to 'nova')
| -rw-r--r-- | nova/tests/test_misc.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/nova/tests/test_misc.py b/nova/tests/test_misc.py index a658e4978..1fbaf304f 100644 --- a/nova/tests/test_misc.py +++ b/nova/tests/test_misc.py @@ -24,18 +24,19 @@ from nova.utils import parse_mailmap, str_dict_replace, synchronized class ProjectTestCase(test.TestCase): def test_authors_up_to_date(self): - if os.path.exists('.bzr'): + topdir = os.path.normpath(os.path.dirname(__file__) + '/../../') + if os.path.exists(os.path.join(topdir, '.bzr')): contributors = set() - mailmap = parse_mailmap('.mailmap') + mailmap = parse_mailmap(os.path.join(topdir, '.mailmap')) import bzrlib.workingtree - tree = bzrlib.workingtree.WorkingTree.open('.') + tree = bzrlib.workingtree.WorkingTree.open(topdir) tree.lock_read() try: parents = tree.get_parent_ids() g = tree.branch.repository.get_graph() - for p in parents[1:]: + for p in parents: rev_ids = [r for r, _ in g.iter_ancestry(parents) if r != "null:"] revs = tree.branch.repository.get_revisions(rev_ids) @@ -44,7 +45,8 @@ class ProjectTestCase(test.TestCase): email = author.split(' ')[-1] contributors.add(str_dict_replace(email, mailmap)) - authors_file = open('Authors', 'r').read() + authors_file = open(os.path.join(topdir, 'Authors'), + 'r').read() missing = set() for contributor in contributors: |
