Esempio n. 1
0
def test_serialize_content_range_defined():
    from webob.descriptors import serialize_content_range

    assert serialize_content_range((0, 500, 1234)) == "bytes 0-499/1234"
Esempio n. 2
0
def test_serialize_content_range_invalid():
    from webob.descriptors import serialize_content_range

    with pytest.raises(ValueError):
        serialize_content_range((1, ))
Esempio n. 3
0
def test_serialize_content_range_asterisk():
    from webob.descriptors import serialize_content_range

    assert serialize_content_range((0, 500)) == "bytes 0-499/*"
Esempio n. 4
0
def test_serialize_content_range_none():
    from webob.descriptors import serialize_content_range

    assert serialize_content_range(None) == "None"  # XXX: Seems wrong
Esempio n. 5
0
def test_serialize_content_range_emptystr():
    from webob.descriptors import serialize_content_range

    assert serialize_content_range("") is None
Esempio n. 6
0
def test_serialize_content_range_asterisk():
    from webob.descriptors import serialize_content_range
    assert serialize_content_range((0, 500)) == 'bytes 0-499/*'
Esempio n. 7
0
def test_serialize_content_range_defined():
    from webob.descriptors import serialize_content_range
    assert serialize_content_range((0, 500, 1234)) == 'bytes 0-499/1234'
Esempio n. 8
0
def test_serialize_content_range_emptystr():
    from webob.descriptors import serialize_content_range
    assert serialize_content_range('') == None
Esempio n. 9
0
def test_serialize_content_range_invalid():
    from webob.descriptors import serialize_content_range
    with pytest.raises(ValueError):
        serialize_content_range((1,))
Esempio n. 10
0
def test_serialize_content_range_asterisk():
    from webob.descriptors import serialize_content_range
    eq_(serialize_content_range((0, 500)), 'bytes 0-499/*')
Esempio n. 11
0
def test_serialize_content_range_none():
    from webob.descriptors import serialize_content_range
    assert serialize_content_range(None) == 'None' ### XXX: Seems wrong
Esempio n. 12
0
def test_serialize_content_range_emptystr():
    from webob.descriptors import serialize_content_range
    eq_(serialize_content_range(''), None)
Esempio n. 13
0
def test_serialize_content_range_none():
    from webob.descriptors import serialize_content_range
    eq_(serialize_content_range(None), 'None')  ### XXX: Seems wrong
Esempio n. 14
0
def test_serialize_content_range_none():
    from webob.descriptors import serialize_content_range
    eq_(serialize_content_range(None), 'None') ### XXX: Seems wrong
Esempio n. 15
0
def test_serialize_content_range_asterisk():
    from webob.descriptors import serialize_content_range

    eq_(serialize_content_range((0, 500)), "bytes 0-499/*")
Esempio n. 16
0
def test_serialize_content_range_emptystr():
    from webob.descriptors import serialize_content_range

    eq_(serialize_content_range(""), None)