コード例 #1
0
def test_mk_alloc_id_strings():
    with pytest.raises(AssertionError):
        output = platform.mk_alloc_id("test", "test", "test")
コード例 #2
0
def test_mk_alloc_id_no_args():
    with pytest.raises(TypeError):
        output = platform.mk_alloc_id()
コード例 #3
0
def test_mk_alloc_id_random_args():
    output = platform.mk_alloc_id("test", 100, 2)
    assert output == 1636
コード例 #4
0
def test_mk_alloc_id_default_value():
    output = platform.mk_alloc_id(0, 100)
    assert output == 1124
コード例 #5
0
def test_mk_alloc_id_both_max():
    output = platform.mk_alloc_id(0, 127, 4)
    assert output == 2175
コード例 #6
0
def test_mk_alloc_id_both_args_negative():
    with pytest.raises(AssertionError):
        output = platform.mk_alloc_id(0, -1, -1)
コード例 #7
0
def test_mk_alloc_id_idx_idx_too_big():
    with pytest.raises(AssertionError):
        output = platform.mk_alloc_id(0, 0, 5)
コード例 #8
0
def test_mk_alloc_id_onu_id_too_big():
    with pytest.raises(AssertionError):
        output = platform.mk_alloc_id(0, 128, 0)
コード例 #9
0
def test_mk_alloc_id_all_zeros():
    output = platform.mk_alloc_id(0, 0, 0)
    assert output == 1024