本文整理汇总了Python中bumpr.releaser.Releaser.bump方法的典型用法代码示例。如果您正苦于以下问题:Python Releaser.bump方法的具体用法?Python Releaser.bump怎么用?Python Releaser.bump使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bumpr.releaser.Releaser
的用法示例。
在下文中一共展示了Releaser.bump方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_bump
# 需要导入模块: from bumpr.releaser import Releaser [as 别名]
# 或者: from bumpr.releaser.Releaser import bump [as 别名]
def test_bump(self):
with workspace('fake', '1.2.3.dev') as wksp:
config = Config({'file': 'fake.py', 'files': [wksp.readme]})
releaser = Releaser(config)
with patch.object(releaser, 'commit') as commit:
with patch.object(releaser, 'tag') as tag:
releaser.bump()
self.assertFalse(commit.called)
self.assertFalse(tag.called)
for filename in wksp.module, wksp.readme:
with open(filename) as f:
content = f.read()
self.assertIn('1.2.3', content)
self.assertNotIn('1.2.3.dev', content)
示例2: test_bump_vcs
# 需要导入模块: from bumpr.releaser import Releaser [as 别名]
# 或者: from bumpr.releaser.Releaser import bump [as 别名]
def test_bump_vcs(workspace, mocker):
config = Config({
'file': 'fake.py',
'files': [str(workspace.readme)],
'vcs': 'fake',
})
releaser = Releaser(config)
commit = mocker.patch.object(releaser, 'commit')
tag = mocker.patch.object(releaser, 'tag')
releaser.bump()
assert commit.call_count == 1
assert tag.called
for file in workspace.module, workspace.readme:
with file.open() as f:
content = f.read()
assert '1.2.3' in content
assert '1.2.3.dev' not in content
示例3: test_bump_vcs_with_annotation
# 需要导入模块: from bumpr.releaser import Releaser [as 别名]
# 或者: from bumpr.releaser.Releaser import bump [as 别名]
def test_bump_vcs_with_annotation(workspace, mocker):
config = Config({
'file': 'fake.py',
'files': [str(workspace.readme)],
'vcs': 'fake',
'tag_annotation': 'version {version}'
})
releaser = Releaser(config)
commit = mocker.patch.object(releaser, 'commit')
tag = mocker.patch.object(releaser.vcs, 'tag')
releaser.bump()
assert commit.call_count == 1
tag.assert_called_with(str(releaser.version), 'version {0}'.format(releaser.version))
for file in workspace.module, workspace.readme:
with file.open() as f:
content = f.read()
assert '1.2.3' in content
assert '1.2.3.dev' not in content
示例4: test_bump
# 需要导入模块: from bumpr.releaser import Releaser [as 别名]
# 或者: from bumpr.releaser.Releaser import bump [as 别名]
def test_bump(workspace, mocker):
config = Config({
'file': 'fake.py',
'files': [str(workspace.readme)],
})
releaser = Releaser(config)
hook = mocker.MagicMock()
mocker.patch.object(releaser, 'hooks', [hook])
commit = mocker.patch.object(releaser, 'commit')
tag = mocker.patch.object(releaser, 'tag')
releaser.bump()
assert not commit.called
assert not tag.called
assert hook.bump.called
for file in workspace.module, workspace.readme:
with file.open() as f:
content = f.read()
assert '1.2.3' in content
assert '1.2.3.dev' not in content