Ejemplo n.º 1
0
def test_s3object_to_asset_binary():
    resp = stubs.s3get_response_binary()
    bobj = S3resource.from_s3object(resp)
    assert bobj.content_length == resp['ContentLength']
    assert bobj.contenttype == resp['ContentType']
    assert bobj.last_modified == resp['LastModified']
    assert bobj.metadata == resp['Metadata']
    assert bobj.resourcetype == resp['Metadata']['resourcetype']
    assert bobj.content == stubs.binary_content
Ejemplo n.º 2
0
def test_s3object_to_asset_binary_has_no_json():
    bobj = S3resource.from_s3object(stubs.s3get_response_binary())
    assert bobj.content == stubs.binary_content
    with pytest.raises(ValueError):
        assert bobj.data == stubs.binary_content