本文整理汇总了Python中buildbot.changes.mail.CVSMaildirSource类的典型用法代码示例。如果您正苦于以下问题:Python CVSMaildirSource类的具体用法?Python CVSMaildirSource怎么用?Python CVSMaildirSource使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CVSMaildirSource类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_CVSMaildirSource_create_change_with_no_comment
def test_CVSMaildirSource_create_change_with_no_comment(self):
# Strip off comments
msg = cvs1_11_msg[:cvs1_11_msg.find('Commented out some stuff')]
m = message_from_string(msg)
src = CVSMaildirSource('/dev/null')
chdict = src.parse(m)[1]
self.assertEqual(chdict['comments'], None)
示例2: test_CVSMaildirSource_create_change_with_no_repository
def test_CVSMaildirSource_create_change_with_no_repository(self):
msg = cvs1_11_msg.replace(
'CVSROOT: :ext:cvshost.example.com:/cvsroot', '')
m = message_from_string(msg)
src = CVSMaildirSource('/dev/null')
chdict = src.parse(m)[1]
self.assertEqual(chdict['repository'], None)
示例3: test_CVSMaildirSource_create_change_with_no_files
def test_CVSMaildirSource_create_change_with_no_files(self):
# A message with no files is likely not for us
msg = cvs1_11_msg.replace('Files: base/module/src/make GNUmakefile,1.362,1.363', '')
m = message_from_string(msg)
src = CVSMaildirSource('/dev/null')
chdict = src.parse(m)
self.assertEqual(chdict, None)
示例4: test_CVSMaildirSource_create_change_with_branch
def test_CVSMaildirSource_create_change_with_branch(self):
# Branch is indicated after 'Tag:' in modified file list
msg = cvs1_11_msg.replace(' GNUmakefile',
' Tag: Test_Branch\n GNUmakefile')
m = message_from_string(msg)
src = CVSMaildirSource('/dev/null')
chdict = src.parse(m)[1]
self.assertEqual(chdict['branch'], 'Test_Branch')
示例5: test_CVSMaildirSource_create_change_with_category
def test_CVSMaildirSource_create_change_with_category(self):
msg = cvs1_11_msg.replace('Category: None', 'Category: Test category')
m = message_from_string(msg)
src = CVSMaildirSource('/dev/null')
try:
chdict = src.parse( m )
except:
self.fail('Failed to get change from email message.')
self.assert_(chdict['category'] == 'Test category')
示例6: test_CVSMaildirSource_create_change_with_property
def test_CVSMaildirSource_create_change_with_property(self):
m = message_from_string(cvs1_11_msg)
propDict = { 'foo' : 'bar' }
src = CVSMaildirSource('/dev/null', urlmaker=fileToUrl, properties=propDict)
try:
chdict = src.parse( m )
except:
self.fail('Failed to get change from email message.')
self.assert_(chdict['properties']['foo'] == 'bar')
示例7: test_CVSMaildirSource_create_change_with_no_repository
def test_CVSMaildirSource_create_change_with_no_repository(self):
msg = cvs1_11_msg.replace('CVSROOT: :ext:cvshost.example.com:/cvsroot', '')
m = message_from_string(msg)
src = CVSMaildirSource('/dev/null')
try:
chdict = src.parse( m )
except:
self.fail('Failed to get change from email message.')
self.assert_(chdict['repository'] == None )
示例8: test_CVSMaildirSource_create_change_with_no_project
def test_CVSMaildirSource_create_change_with_no_project(self):
msg = cvs1_11_msg.replace('Project: MyModuleName', '')
m = message_from_string(msg)
src = CVSMaildirSource('/dev/null')
try:
chdict = src.parse( m )
except:
self.fail('Failed to get change from email message.')
self.assert_(chdict['project'] == None )
示例9: test_CVSMaildirSource_create_change_from_cvs1_12_with_no_path
def test_CVSMaildirSource_create_change_from_cvs1_12_with_no_path(self):
msg = cvs1_12_msg.replace('Path: base/module/src', '')
m = message_from_string(msg)
src = CVSMaildirSource('/dev/null')
try:
assert src.parse(m)[1]
except ValueError:
pass
else:
self.fail('Expect ValueError.')
示例10: test_CVSMaildirSource_create_change_with_no_files
def test_CVSMaildirSource_create_change_with_no_files(self):
# A message with no files is likely not for us
msg = cvs1_11_msg.replace('Files: base/module/src/make GNUmakefile,1.362,1.363','')
m = message_from_string(msg)
src = CVSMaildirSource('/dev/null')
try:
chdict = src.parse( m )
except:
self.fail('Failed to get change from email message.')
self.assert_(chdict == None )
示例11: test_CVSMaildirSource_create_change_with_no_comment
def test_CVSMaildirSource_create_change_with_no_comment(self):
# Strip off comments
msg = cvs1_11_msg[:cvs1_11_msg.find('Commented out some stuff')]
m = message_from_string(msg)
src = CVSMaildirSource('/dev/null')
try:
chdict = src.parse( m )
except:
self.fail('Failed to get change from email message.')
self.assert_(chdict['comments'] == None )
示例12: test_CVSMaildirSource_create_change_with_bad_cvsmode
def test_CVSMaildirSource_create_change_with_bad_cvsmode(self):
# Branch is indicated after 'Tag:' in modified file list
msg = cvs1_11_msg.replace('Cvsmode: 1.11', 'Cvsmode: 9.99')
m = message_from_string(msg)
src = CVSMaildirSource('/dev/null')
try:
assert src.parse(m)[1]
except ValueError:
pass
else:
self.fail('Expected ValueError')
示例13: test_CVSMaildirSource_create_change_with_branch
def test_CVSMaildirSource_create_change_with_branch(self):
# Branch is indicated afer 'Tag:' in modified file list
msg = cvs1_11_msg.replace(' GNUmakefile',
' Tag: Test_Branch\n GNUmakefile')
m = message_from_string(msg)
src = CVSMaildirSource('/dev/null')
try:
chdict = src.parse( m )
except:
self.fail('Failed to get change from email message.')
self.assert_(chdict['branch'] == 'Test_Branch')
示例14: test_CVSMaildirSource_create_change_from_cvs1_11msg
def test_CVSMaildirSource_create_change_from_cvs1_11msg(self):
m = message_from_string(cvs1_11_msg)
src = CVSMaildirSource('/dev/null')
src, chdict = src.parse(m)
self.assertNotEqual(chdict, None)
self.assertEqual(chdict['author'], 'andy')
self.assertEqual(len(chdict['files']), 1)
self.assertEqual(chdict['files'][0], 'base/module/src/make/GNUmakefile')
self.assertEqual(chdict['comments'], 'Commented out some stuff.\n')
self.assertFalse(chdict['isdir'])
self.assertEqual(chdict['revision'], '2010-08-07 11:11:49')
dateTuple = parsedate_tz('Sat, 07 Aug 2010 11:11:49 +0000')
self.assertEqual(chdict['when'], mktime_tz(dateTuple))
self.assertEqual(chdict['branch'], None)
self.assertEqual(chdict['repository'], ':ext:cvshost.example.com:/cvsroot')
self.assertEqual(chdict['project'], 'MyModuleName')
self.assertEqual(len(chdict['properties']), 0)
self.assertEqual(src, 'cvs')
示例15: test_CVSMaildirSource_create_change_from_cvs1_12msg
def test_CVSMaildirSource_create_change_from_cvs1_12msg(self):
m = message_from_string(cvs1_12_msg)
src = CVSMaildirSource('/dev/null')
src, chdict = src.parse(m)
self.assertNotEqual(chdict, None)
self.assertEqual(chdict['author'], 'andy')
self.assertEqual(len(chdict['files']), 2)
self.assertEqual(chdict['files'][0], 'base/module/src/file1.cpp')
self.assertEqual(chdict['files'][1], 'base/module/src/file2.cpp')
self.assertEqual(chdict['comments'], 'Changes for changes sake\n')
self.assertFalse(chdict['isdir'])
self.assertEqual(chdict['revision'], '2010-08-11 04:56:44')
dateTuple = parsedate_tz('Wed, 11 Aug 2010 04:56:44 +0000')
self.assertEqual(chdict['when'], mktime_tz(dateTuple))
self.assertEqual(chdict['branch'], None)
self.assertEqual(chdict['repository'], ':ext:cvshost.example.com:/cvsroot')
self.assertEqual(chdict['project'], 'MyModuleName')
self.assertEqual(len(chdict['properties']), 0)
self.assertEqual(src, 'cvs')