comparison tests/test_fetch_mappings.py @ 1402:94eb844fd4ab

tests: add test for regex and glob
author Sean Farley <sean.michael.farley@gmail.com>
date Mon, 24 Mar 2014 11:21:01 -0500
parents a17d8874a099
children 3a723188051e
comparison
equal deleted inserted replaced
1401:70cb6ba038fa 1402:94eb844fd4ab
207 branches = set(self.repo[i].branch() for i in self.repo) 207 branches = set(self.repo[i].branch() for i in self.repo)
208 self.assert_('badname' not in branches) 208 self.assert_('badname' not in branches)
209 self.assert_('good-name' in branches) 209 self.assert_('good-name' in branches)
210 self.assertEquals(self.repo[2].branch(), 'default') 210 self.assertEquals(self.repo[2].branch(), 'default')
211 211
212 def test_branchmap_regex_and_glob(self):
213 repo_path = self.load_svndump('branchmap.svndump')
214 branchmap = open(self.branchmap, 'w')
215 branchmap.write("syntax:re\n")
216 branchmap.write("bad(.*) = good-\\1 # stuffy\n")
217 branchmap.write("glob:feat* = default\n")
218 branchmap.close()
219 ui = self.ui()
220 ui.setconfig('hgsubversion', 'branchmap', self.branchmap)
221 commands.clone(ui, test_util.fileurl(repo_path),
222 self.wc_path, branchmap=self.branchmap)
223 branches = set(self.repo[i].branch() for i in self.repo)
224 self.assert_('badname' not in branches)
225 self.assert_('good-name' in branches)
226 self.assertEquals(self.repo[2].branch(), 'default')
227
212 def test_branchmap_tagging(self): 228 def test_branchmap_tagging(self):
213 '''test tagging a renamed branch, which used to raise an exception''' 229 '''test tagging a renamed branch, which used to raise an exception'''
214 repo_path = self.load_svndump('commit-to-tag.svndump') 230 repo_path = self.load_svndump('commit-to-tag.svndump')
215 branchmap = open(self.branchmap, 'w') 231 branchmap = open(self.branchmap, 'w')
216 branchmap.write("magic = art\n") 232 branchmap.write("magic = art\n")