comparison tests/test_fetch_mappings.py @ 1194:49791c40a8a5

maps: change authormap to initialize with an svnmeta object This refactoring will help us break AuthorMaps access of global options via ui.config allowing us to use svnmeta as the central store for reading and writing configuration options.
author Sean Farley <sean.michael.farley@gmail.com>
date Mon, 24 Mar 2014 11:20:46 -0500
parents 28116a204b6a
children 77bd24841a5f
comparison
equal deleted inserted replaced
1193:a55339d35066 1194:49791c40a8a5
82 self.assertEqual(sorted(users), expected_users) 82 self.assertEqual(sorted(users), expected_users)
83 83
84 def test_author_map_no_overwrite(self): 84 def test_author_map_no_overwrite(self):
85 cwd = os.path.dirname(__file__) 85 cwd = os.path.dirname(__file__)
86 orig = os.path.join(cwd, 'fixtures', 'author-map-test.txt') 86 orig = os.path.join(cwd, 'fixtures', 'author-map-test.txt')
87 new = open(self.authors, 'w') 87 # create a fake hgsubversion repo
88 repopath = os.path.join(self.wc_path, '.hg')
89 repopath = os.path.join(repopath, 'svn')
90 if not os.path.isdir(repopath):
91 os.makedirs(repopath)
92 new = open(os.path.join(repopath, 'authors'), 'w')
88 new.write(open(orig).read()) 93 new.write(open(orig).read())
89 new.close() 94 new.close()
90 test = maps.AuthorMap(self.ui(), self.authors) 95 test = maps.AuthorMap(self.repo.svnmeta(skiperrorcheck=True))
91 fromself = set(test) 96 fromself = set(test)
92 test.load(orig) 97 test.load(orig)
93 all_tests = set(test) 98 all_tests = set(test)
94 self.assertEqual(fromself.symmetric_difference(all_tests), set()) 99 self.assertEqual(fromself.symmetric_difference(all_tests), set())
95 100