def test_add_associated_link_match():
    m = GenericModel()
    m._add_associated_link('_associated', 'something', 'http://example.com/1.txt',
                           text='', media_type='text/plain', on_duplicate='error')
    m._add_associated_link('_associated', 'something', 'http://example.com/1.pdf',
                           text='', media_type='application/pdf', on_duplicate='error')
    # one 'document' added, multiple links for it
    assert len(m._associated) == 1
    assert len(m._associated[0]['links']) == 2
dataset/ETHPy150Open opencivicdata/pupa/pupa/tests/scrape/test_model_basics.py/test_add_associated_link_match/original