Beispiel #1
0
 def testNotmuch(self):
     revision = 'f717d2ece1836c863f9cc02abd1ff2539307cd1d'
     matcher = RevlinkMatch(['git://notmuchmail.org/git/(.*)'],
                            r'http://git.notmuchmail.org/git/\1/commit/%s')
     self.assertEqual(
         matcher(revision, 'git://notmuchmail.org/git/notmuch'),
         'http://git.notmuchmail.org/git/notmuch/commit/f717d2ece1836c863f9cc02abd1ff2539307cd1d'
     )
Beispiel #2
0
 def testSingleUnicode(self):
     revision = 'rev'
     matcher = RevlinkMatch(u'test', 'out%s')
     self.assertEqual(matcher(revision, 'test'), 'outrev')
Beispiel #3
0
 def testTwoCaptureGroups(self):
     revision = 'rev'
     matcher = RevlinkMatch('([A-Z]*)Z([0-9]*)', r'\2-\1-%s')
     self.assertEqual(matcher(revision, 'ABCZ43'), '43-ABC-rev')
Beispiel #4
0
 def testSingleString(self):
     revision = 'rev'
     matcher = RevlinkMatch('test', 'out%s')
     self.assertEquals(matcher(revision, 'test'), 'outrev')