コード例 #1
0
def test_fixity_generated_by(monkeypatch, mongodb_settings, agave,
                             generator_uuid):
    monkeypatch.setenv('STORAGE_SYSTEM_PREFIX_OVERRIDE', DATA_DIR)
    fixity_store = FixityStore(mongodb_settings, agave=agave)
    for fname, cksum, tsize, ftype in files.TESTS:
        # 1179fdd6-71e0-504e-bab1-021ce3a72e35 is tests-pytest
        resp = fixity_store.index(fname, generated_by=generator_uuid)
        assert generator_uuid in resp['generated_by']
        resp = fixity_store.index(fname, generated_by=[generator_uuid])
        assert generator_uuid in resp['generated_by']
コード例 #2
0
def test_fixity_no_overrde_child_of(monkeypatch, mongodb_settings, agave):
    monkeypatch.setenv('STORAGE_SYSTEM_PREFIX_OVERRIDE', DATA_DIR)
    fixity_store = FixityStore(mongodb_settings, agave=agave)
    file_store = FileStore(mongodb_settings)
    for fname, cksum, tsize, ftype in files.TESTS:
        file_uuid = file_store.get_typeduuid(fname, binary=False)
        # This is one of the test files not indexed in the Fixity test collection
        resp = fixity_store.index(
            fname, child_of='105fb204-530b-5915-9fd6-caf88ca9ad8a')
        assert resp['child_of'] == [file_uuid]
コード例 #3
0
def test_fixity_limit_rate_pause(monkeypatch, mongodb_settings, agave):
    monkeypatch.setenv('STORAGE_SYSTEM_PREFIX_OVERRIDE', DATA_DIR)
    fixity_store = FixityStore(mongodb_settings,
                               batch_size=5,
                               batch_window=1,
                               except_on_limit=False,
                               agave=agave)
    for fname, cksum, tsize, ftype in files.TESTS:
        resp = fixity_store.index(fname)
        assert resp['type'] == ftype
コード例 #4
0
def test_fixity_limit_rate_exception(monkeypatch, mongodb_settings, agave):
    monkeypatch.setenv('STORAGE_SYSTEM_PREFIX_OVERRIDE', DATA_DIR)
    fixity_store = FixityStore(mongodb_settings,
                               batch_size=5,
                               batch_window=1,
                               except_on_limit=True,
                               agave=agave)
    with pytest.raises(RateLimitExceeded):
        for fname, cksum, tsize, ftype in files.TESTS:
            resp = fixity_store.index(fname)
            assert resp['type'] == ftype
コード例 #5
0
def test_fixity_normpath(mongodb_settings, filename, fuuid, agave):
    base = FixityStore(mongodb_settings, agave=agave)
    identifier_string_uuid = base.get_typeduuid(filename, binary=False)
    assert identifier_string_uuid == fuuid
コード例 #6
0
def test_fixity_checksum(monkeypatch, mongodb_settings, agave):
    monkeypatch.setenv('STORAGE_SYSTEM_PREFIX_OVERRIDE', DATA_DIR)
    fixity_store = FixityStore(mongodb_settings, agave=agave)
    for fname, cksum, tsize, ftype in files.TESTS:
        resp = fixity_store.index(fname)
        assert resp['checksum'] == cksum
コード例 #7
0
def test_fixity_pathmapping(monkeypatch, mongodb_settings, agave, filename,
                            level, ftype):
    monkeypatch.setenv('STORAGE_SYSTEM_PREFIX_OVERRIDE', DATA_DIR)
    fixity_store = FixityStore(mongodb_settings, agave=agave)
    resp = fixity_store.index(filename)
    assert resp['type'] == ftype
コード例 #8
0
def test_fixity_delete(mongodb_settings):
    fixity_store = FixityStore(mongodb_settings)
    for fname, cksum, tsize, ftype in files.TESTS:
        doc = fixity_store.find_one_by_id(name=fname)
        fixity_store.delete_document(doc['uuid'])