Exemple #1
0
def test_it_truncates_the_file():
    version = "0.0.111"
    fo = StringIO(version)
    fb = FileBump(fo, version)
    fb.bump("minor")
    fo.seek(0)
    assert fo.read() == "0.1.0"
Exemple #2
0
def test_cache_write_to_file():
    version = "0.0.0"
    match_against = "something completely unrelated"
    fo = StringIO(version)
    fb = FileBump(fo, version)
    fb.file_cache = match_against
    fb.write_cache_to_file()
    fo.seek(0)
    assert fo.read() == match_against
Exemple #3
0
def bumpage():
    current_version = args.current
    level = args.level
    label = args.label

    vb = VersionBump(current_version)
    vb.bump(level, label)

    for filename in FILES:
        fo = open(filename, 'r+')
        try:
            fb = FileBump(fo, current_version)
            fb.bump(level)
        except ValueError:
            raise ValueError('Version not in file [{}].'.format(filename))

    new_version = vb.get()
    print(new_version)
Exemple #4
0
def test_bump():
    version = "2.4.1"
    fo = StringIO(version)
    fb = FileBump(fo, version)
    fb.bump("patch")
    assert fb.current_version == "2.4.2"