当前位置: 首页>>代码示例>>Python>>正文


Python Releaser.prepare方法代码示例

本文整理汇总了Python中bumpr.releaser.Releaser.prepare方法的典型用法代码示例。如果您正苦于以下问题:Python Releaser.prepare方法的具体用法?Python Releaser.prepare怎么用?Python Releaser.prepare使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在bumpr.releaser.Releaser的用法示例。


在下文中一共展示了Releaser.prepare方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_prepare

# 需要导入模块: from bumpr.releaser import Releaser [as 别名]
# 或者: from bumpr.releaser.Releaser import prepare [as 别名]
def test_prepare(workspace, mocker):
    config = Config({
        'file': 'fake.py',
        'files': [str(workspace.readme)],
        'prepare': {
            'part': Version.PATCH,
            'suffix': 'dev',
        }
    })
    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.prepare()

    assert not commit.called
    assert not tag.called
    assert hook.prepare.called

    for file in workspace.module, workspace.readme:
        with file.open() as f:
            content = f.read()
            assert '1.2.4.dev' in content
            assert '1.2.3' not in content
开发者ID:noirbizarre,项目名称:bumpr,代码行数:28,代码来源:test_releaser.py

示例2: test_prepare

# 需要导入模块: from bumpr.releaser import Releaser [as 别名]
# 或者: from bumpr.releaser.Releaser import prepare [as 别名]
    def test_prepare(self):
        with workspace('fake', '1.2.3') as wksp:
            config = Config({
                'file': 'fake.py',
                'files': [wksp.readme],
                'prepare': {
                    'part': Version.PATCH,
                    'suffix': 'dev',
                }
            })
            releaser = Releaser(config)
            with patch.object(releaser, 'commit') as commit:
                with patch.object(releaser, 'tag') as tag:
                    releaser.prepare()
                    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.4.dev', content)
                    self.assertNotIn('1.2.3', content)
开发者ID:eight04,项目名称:bumpr,代码行数:24,代码来源:test_releaser.py


注:本文中的bumpr.releaser.Releaser.prepare方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。