Ejemplo n.º 1
0
def test_illegal_len_version(version_tuple):
    """test_version | Raise if len(version) not in (3, 4)"""
    with pytest.raises(Exception):
        swversion.get_version_string(version_tuple)
Ejemplo n.º 2
0
def test_four_version():
    """test_version | 3 digit + string tuple -> version string"""
    assert swversion.get_version_string((0, 1, 2, "alpha")) == "0.1.2.alpha"
Ejemplo n.º 3
0
def test_illegal_three_version():
    """test_version | Raise if a 3-len tuple has a non-digit"""
    with pytest.raises(TypeError):
        swversion.get_version_string(("one", "two", "three"))
Ejemplo n.º 4
0
def test_legal_version(version_tuple):
    """test_version | version tuple -> version string"""
    assert swversion.get_version_string(version_tuple[1]) == version_tuple[0]
Ejemplo n.º 5
0
 def test_four_version(self):
     """test_version | 3 digit + string tuple -> version string
     """
     assert swversion.get_version_string((0, 1, 0, 'alpha')) == '0.1.0-alpha'
Ejemplo n.º 6
0
 def test_illegal_three_version(self):
     """test_version | Raise if a 3-len tuple has a non-digit
     """
     with pytest.raises(TypeError):
         swversion.get_version_string(('one', 'two', 'three'))