示例#1
0
def bump_version():
    module_name, dry_run, new_version = config.common_arguments()

    attributes.replace_attribute(
        module_name,
        '__version__',
        new_version,
        dry_run=dry_run)
示例#2
0
def test_replace_attribute_dry_run(python_module):
    attributes.replace_attribute('test_app',
                                 '__version__',
                                 '1.0.0',
                                 dry_run=True)
    expected_content = list(context.initial_init_content)
    assert '\n'.join(expected_content) == ''.join(
        open(context.tmp_file).readlines())
示例#3
0
def increment_version(context):
    """Increments the __version__ attribute of your module's __init__."""

    attributes.replace_attribute(context.module_name,
                                 '__version__',
                                 context.new_version,
                                 dry_run=context.dry_run)
    log.info('Bumped version from %s to %s' %
             (context.current_version, context.new_version))
示例#4
0
def increment_version(context):
    """Increments the __version__ attribute of your module's __init__."""

    attributes.replace_attribute(
        context.module_name,
        '__version__',
        context.new_version,
        dry_run=context.dry_run)
    log.info('Bumped version from %s to %s' % (context.current_version, context.new_version))
示例#5
0
def test_replace_attribute_dry_run():
    attributes.replace_attribute(
        'test_app',
        '__version__',
        '1.0.0',
        dry_run=True
    )
    expected_content = list(context.initial_init_content)
    assert '\n'.join(expected_content) == ''.join(open(context.tmp_file).readlines())
示例#6
0
    def test_replace_attribute_dry_run(self):
        attributes.replace_attribute('test_app',
                                     '__version__',
                                     '1.0.0',
                                     dry_run=True)

        expected_content = list(self.initial_init_content)
        self.assertEquals('\n'.join(expected_content),
                          ''.join(open(self.tmp_file).readlines()))
示例#7
0
def test_replace_attribute():
    attributes.replace_attribute('test_app',
                                 '__version__',
                                 '1.0.0',
                                 dry_run=False)
    expected_content = list(context.initial_init_content)
    expected_content[2] = "__version__ = '1.0.0'"
    assert '\n'.join(expected_content) == ''.join(
        open(context.tmp_file).readlines())
示例#8
0
    def test_replace_attribute_dry_run(self):
        attributes.replace_attribute(
            'test_app',
            '__version__',
            '1.0.0',
            dry_run=True
        )

        expected_content = list(self.initial_init_content)
        self.assertEquals(
            '\n'.join(expected_content),
            ''.join(
                open(self.tmp_file).readlines()
            )
        )
示例#9
0
def test_replace_attribute(python_module):
    attributes.replace_attribute('test_app', '__version__', '1.0.0', dry_run=False)
    expected_content = list(context.initial_init_content)
    expected_content[2] = "__version__ = '1.0.0'"
    assert '\n'.join(expected_content) == ''.join(open(context.tmp_file).readlines())