示例#1
0
def test_is_content_range_valid():
    assert not _is_content_range_valid( None, 99, 90)
    assert not _is_content_range_valid( 99, None, 90)
    assert _is_content_range_valid(None, None, 90)
    assert not _is_content_range_valid(None, 99, 90)
    assert _is_content_range_valid(0, 99, None)
    assert not _is_content_range_valid(0, 99, 90, response=True)
    assert _is_content_range_valid(9, 99, None, response=True)
    assert _is_content_range_valid(0, 99, 90)
示例#2
0
def test_is_content_range_valid():
    assert not _is_content_range_valid(None, 99, 90)
    assert not _is_content_range_valid(99, None, 90)
    assert _is_content_range_valid(None, None, 90)
    assert not _is_content_range_valid(None, 99, 90)
    assert _is_content_range_valid(0, 99, None)
    assert not _is_content_range_valid(0, 99, 90, response=True)
    assert _is_content_range_valid(0, 99, 90)
示例#3
0
def test_is_content_range_valid_stop_greater_than_length():
    contentrange = ContentRange(0, 99, 100)
    assert_equal(_is_content_range_valid(0, 99, 90), True)
示例#4
0
def test_is_content_range_valid_length_none():
    contentrange = ContentRange(0, 99, 100)
    assert_equal(_is_content_range_valid(0, 99, None), True)
示例#5
0
def test_is_content_range_valid_stop_greater_than_length_response():
    contentrange = ContentRange(0, 99, 100)
    assert_equal(_is_content_range_valid(0, 99, 90, response=True), False)
示例#6
0
def test_is_content_range_valid_start_none():
    contentrange = ContentRange(0, 99, 100)
    assert_equal(_is_content_range_valid(None, 99, 90), False)
示例#7
0
def test_is_content_range_valid_stop_greater_than_length():
    contentrange = ContentRange(0, 99, 100)
    assert_equal(_is_content_range_valid(0, 99, 90), True)
示例#8
0
def test_is_content_range_valid_stop_greater_than_length_response():
    contentrange = ContentRange(0, 99, 100)
    assert_equal(_is_content_range_valid(0, 99, 90, response=True), False)
示例#9
0
def test_is_content_range_valid_length_none():
    contentrange = ContentRange(0, 99, 100)
    assert_equal(_is_content_range_valid(0, 99, None), True)
示例#10
0
def test_is_content_range_valid_start_none():
    contentrange = ContentRange(0, 99, 100)
    assert_equal(_is_content_range_valid(None, 99, 90), False)