Example #1
0
def test_RollingBlob_init():
    with pytest.raises(ValueError):
        resources.RollingBlob(name='y')

    with pytest.raises(ValueError):
        resources.RollingBlob(oid='x', name='y')

    resources.RollingBlob(oid='x')
Example #2
0
def test_RollingBlob_add(cdstar):
    rb = resources.RollingBlob(oid='x')

    with pytest.raises(ValueError):
        rb.add(cdstar, None, suffix='_')

    rb.add(cdstar, None)
Example #3
0
def test_RollingBlob_get_object2(cdstar):
    rb = resources.RollingBlob(oid='x')
    rb.get_object(cdstar)
    assert rb.collection == 'c'
Example #4
0
def test_RollingBlob_get_object(mocker):
    rb = resources.RollingBlob(name='name', collection='collection')
    obj = rb.get_object(mocker.Mock())
    assert obj.metadata['collection'] == 'collection'
Example #5
0
def test_RollingBlob_expunge(cdstar):
    rb = resources.RollingBlob(oid='x')
    assert rb.expunge(cdstar, keep=1) == 1
Example #6
0
def test_RollingBlob_latest(cdstar):
    rb = resources.RollingBlob(oid='x')
    assert rb.latest(cdstar).id == '20181212T010101Z'