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


Python Releaser.bump方法代码示例

本文整理汇总了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)
开发者ID:eight04,项目名称:bumpr,代码行数:17,代码来源:test_releaser.py

示例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
开发者ID:noirbizarre,项目名称:bumpr,代码行数:22,代码来源:test_releaser.py

示例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
开发者ID:noirbizarre,项目名称:bumpr,代码行数:23,代码来源:test_releaser.py

示例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
开发者ID:noirbizarre,项目名称:bumpr,代码行数:25,代码来源:test_releaser.py


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