示例#1
0
文件: test_gitr.py 项目: tbarron/gitr
def test_vi_xbuild():
    """
    iv = ['7', '19', '23']
    opts = {'--build': True}
    rv = ['7', '19', '23', '1']
    """
    pytest.dbgfunc()
    inp, exp = '7.19.23', '7.19.23.1'
    assert exp.split('.') == gitr.version_increment(inp.split('.'),
                                                    {'--build': True})
示例#2
0
文件: test_gitr.py 项目: tbarron/gitr
def test_vi_ibuild(tmpdir):
    """
    iv = ['7', '19', '23', '4']
    opts = {'--build': True}
    rv = ['7', '19', '23', '5']
    """
    pytest.dbgfunc()
    inp, exp = '7.19.23.4', '7.19.23.5'
    assert exp.split('.') == gitr.version_increment(inp.split('.'),
                                                    {'bv': True})
示例#3
0
文件: test_gitr.py 项目: tbarron/gitr
def test_vi_minor():
    """
    iv = ['7', '19', '23']
    opts = {'--minor': True}
    rv = ['7', '20', '0']
    """
    pytest.dbgfunc()
    inp, exp = '7.19.23', '7.20.0'
    assert exp.split('.') == gitr.version_increment(inp.split('.'),
                                                    {'--minor': True})
示例#4
0
文件: test_gitr.py 项目: tbarron/gitr
def test_vi_patch():
    """
    iv = ['7', '19', '23']
    opts = {'--patch': True}
    rv = ['7', '19', '24']
    """
    pytest.dbgfunc()
    inp, exp = '7.19.23', '7.19.24'
    assert exp.split('.') == gitr.version_increment(inp.split('.'),
                                                    {'--patch': True})
示例#5
0
文件: test_gitr.py 项目: tbarron/gitr
def test_vi_ibuild(tmpdir):
    """
    iv = ['7', '19', '23', '4']
    opts = {'--build': True}
    rv = ['7', '19', '23', '5']
    """
    pytest.dbgfunc()
    inp, exp = '7.19.23.4', '7.19.23.5'
    assert exp.split('.') == gitr.version_increment(inp.split('.'),
                                                    {'bv': True})
示例#6
0
文件: test_gitr.py 项目: tbarron/gitr
def test_vi_xbuild():
    """
    iv = ['7', '19', '23']
    opts = {'--build': True}
    rv = ['7', '19', '23', '1']
    """
    pytest.dbgfunc()
    inp, exp = '7.19.23', '7.19.23.1'
    assert exp.split('.') == gitr.version_increment(inp.split('.'),
                                                    {'--build': True})
示例#7
0
文件: test_gitr.py 项目: tbarron/gitr
def test_vi_patch():
    """
    iv = ['7', '19', '23']
    opts = {'--patch': True}
    rv = ['7', '19', '24']
    """
    pytest.dbgfunc()
    inp, exp = '7.19.23', '7.19.24'
    assert exp.split('.') == gitr.version_increment(inp.split('.'),
                                                    {'--patch': True})
示例#8
0
文件: test_gitr.py 项目: tbarron/gitr
def test_vi_minor():
    """
    iv = ['7', '19', '23']
    opts = {'--minor': True}
    rv = ['7', '20', '0']
    """
    pytest.dbgfunc()
    inp, exp = '7.19.23', '7.20.0'
    assert exp.split('.') == gitr.version_increment(inp.split('.'),
                                                    {'--minor': True})
示例#9
0
文件: test_gitr.py 项目: tbarron/gitr
def test_vi_long(basic, tmpdir):
    """
    iv = ['7', '19', 'foo', 'sample', 'wokka']
    opts = {'--build': True}
    sys.exit('7.19.foo.sample.wokka' is not a recognized version format)
    """
    bf = pytest.basic_fx
    inp = '7.19.foo.sample.wokka'
    exp = bf['badform'].format(inp)
    with pytest.raises(SystemExit) as e:
        res = gitr.version_increment(inp.split('.'), {'bv': True})
    assert exp in str(e)
示例#10
0
文件: test_gitr.py 项目: tbarron/gitr
def test_vi_long(basic, tmpdir):
    """
    iv = ['7', '19', 'foo', 'sample', 'wokka']
    opts = {'--build': True}
    sys.exit('7.19.foo.sample.wokka' is not a recognized version format)
    """
    bf = pytest.basic_fx
    inp = '7.19.foo.sample.wokka'
    exp = bf['badform'].format(inp)
    with pytest.raises(SystemExit) as e:
        res = gitr.version_increment(inp.split('.'), {'bv': True})
    assert exp in str(e)