Beispiel #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)
Beispiel #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"
Beispiel #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"))
Beispiel #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]
Beispiel #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'
Beispiel #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'))