コード例 #1
0
def test_files_links_add_link(mongodb_settings):
    base = FileStore(mongodb_settings)
    for key, doc, uuid_val in file.UPDATES:
        resp = base.add_link(uuid_val, '1040f664-a654-0b71-4189-2ac6f77a05a7',
                             'child_of')
        assert resp is True
        links = base.get_links(uuid_val, 'child_of')
        assert '1040f664-a654-0b71-4189-2ac6f77a05a7' in links
コード例 #2
0
def test_files_links_add_link(mongodb_settings):
    base = FileStore(mongodb_settings)
    for key, doc, uuid_val in file.UPDATES:
        resp = base.add_link(uuid_val, [
            '1040f664-a654-0b71-4189-2ac6f77a05a7',
            '104dae4d-a677-5991-ae1c-696d2ee9884e',
            '10483e8d-6602-532a-8941-176ce20dd05a'
        ], 'child_of')
        assert resp is True
        links = base.get_links(uuid_val, 'child_of')
        assert '1040f664-a654-0b71-4189-2ac6f77a05a7' in links
コード例 #3
0
def test_files_links_add_invalid_linkage(mongodb_settings):
    base = FileStore(mongodb_settings)
    for key, doc, uuid_val in file.UPDATES:
        resp = base.add_link(uuid_val, '1040f664-a654-0b71-4189-2ac6f77a05a7',
                             'acted_on')
        assert resp is False