def test_listing_collections_sort():
    client = AtomClient(**AUTH)
    asc = client.find_collections(sort_by="asc")
    assert len(asc) == 2
    assert asc[0]["title"] == "Test fonds"
    assert asc[0]["type"] == "resource"

    desc = client.find_collections(sort_by="desc")
    assert len(desc) == 2
    assert desc[0]["title"] == "Top Fonds"
    assert desc[0]["type"] == "resource"
Beispiel #2
0
def test_listing_collections_sort():
    client = AtomClient(**AUTH)
    asc = client.find_collections(sort_by='asc')
    assert len(asc) == 2
    assert asc[0]['title'] == 'Test fonds'
    assert asc[0]['type'] == 'resource'

    desc = client.find_collections(sort_by='desc')
    assert len(desc) == 2
    assert desc[0]['title'] == 'Top Fonds'
    assert desc[0]['type'] == 'resource'
Beispiel #3
0
def test_empty_dates():
    client = AtomClient(**AUTH)
    record = client.get_resource_component_children('test-child')
    assert record['dates'] == ''
    assert record['date_expression'] == ''
    record = client.get_resource_component_and_children('test-child',
                                                        recurse_max_level=1)
    # dates are mandatory for resources, so this record does have a date but no expression
    assert record['date_expression'] == ''
    collections = client.find_collections()
    assert collections[0]['date_expression'] == ''
def test_empty_dates():
    client = AtomClient(**AUTH)
    record = client.get_resource_component_children("test-child")
    assert record["dates"] == ""
    assert record["date_expression"] == ""
    record = client.get_resource_component_and_children(
        "test-child", recurse_max_level=1
    )
    # dates are mandatory for resources, so this record does have a date but no expression
    assert record["date_expression"] == ""
    collections = client.find_collections()
    assert collections[0]["date_expression"] == ""
def test_listing_collections_search_spaces():
    client = AtomClient(**AUTH)
    collections = client.find_collections(identifier="2015044 Aa Ac")
    assert len(collections) == 1
    assert collections[0]["title"] == "Resource with spaces in the identifier"
    assert collections[0]["levelOfDescription"] == "Fonds"
def test_find_collections_search_no_results():
    client = AtomClient(**AUTH)
    no_results = client.find_collections(search_pattern="Nonexistent")
    assert len(no_results) == 0
def test_find_collections_search():
    client = AtomClient(**AUTH)
    collections = client.find_collections(search_pattern="Test fonds")
    assert len(collections) == 1
    assert collections[0]["title"] == "Test fonds"
    assert collections[0]["type"] == "resource"
def test_rendering_record_containing_a_note():
    client = AtomClient(**AUTH)
    collections = client.find_collections()
    assert len(collections) == 2
    assert collections[0]["notes"][0]["content"] == "Note content"
def test_listing_collections():
    client = AtomClient(**AUTH)
    collections = client.find_collections()
    assert len(collections) == 2
    assert collections[0]["title"] == "Top Fonds"
    assert collections[0]["type"] == "resource"
def test_identifier_search_exact_match():
    client = AtomClient(**AUTH)
    assert client.find_collection_ids(identifier="F1") == ["top-level-fonds"]
    assert client.count_collections(identifier="F1") == 1
    assert len(client.find_collections(identifier="F1")) == 1
def test_listing_collections_search_spaces():
    client = AtomClient(**AUTH)
    collections = client.find_collections(identifier="2015044 Aa Ac")
    assert len(collections) == 1
    assert collections[0]['title'] == 'Resource with spaces in the identifier'
    assert collections[0]['levelOfDescription'] == 'Fonds'
def test_find_collections_search_no_results():
    client = AtomClient(**AUTH)
    no_results = client.find_collections(search_pattern='Nonexistent')
    assert len(no_results) == 0
Beispiel #13
0
def test_find_collections_search():
    client = AtomClient(**AUTH)
    collections = client.find_collections(search_pattern='Test fonds')
    assert len(collections) == 1
    assert collections[0]['title'] == 'Test fonds'
    assert collections[0]['type'] == 'resource'
def test_rendering_record_containing_a_note():
    client = AtomClient(**AUTH)
    collections = client.find_collections()
    assert len(collections) == 2
    assert collections[0]['notes'][0]['content'] == 'Note content'
Beispiel #15
0
def test_listing_collections():
    client = AtomClient(**AUTH)
    collections = client.find_collections()
    assert len(collections) == 2
    assert collections[0]['title'] == 'Top Fonds'
    assert collections[0]['type'] == 'resource'
def test_identifier_search_exact_match():
    client = AtomClient(**AUTH)
    assert client.find_collection_ids(identifier='F1') == ['top-level-fonds']
    assert client.count_collections(identifier='F1') == 1
    assert len(client.find_collections(identifier='F1')) == 1