

def test_nested():
    text = 'The US claimed that ISIL had attacked Iraq and taken the city of Mosul'
    parse = '(ROOT (S (NP (DT The) (NNP US)) (VP (VBD claimed) (SBAR (IN that) (S (NP (NNP ISIL)) (VP (VBD had) (VP (VP (VBN attacked) (NP (NNP Iraq))) (CC and) (VP (VBN taken) (NP (NP (DT the) (NN city)) (PP (IN of) (NP (NNP Mosul))))))))))))'
    parsed = utilities._format_parsed_str(parse)
    dict = {
        'test123': {
            'sents': {
                '0': {
                    'content': text,
                    'parsed': parse,
                },
            },
            'meta': {
                'date': '20150101',
            },
        },
    }
    return_dict = petrarch.do_coding(dict, None)
    assert (return_dict['test123']['sents']['0']['events'] == [['USA', 'IMGMUSISI', '112']])

dataset/ETHPy150Open openeventdata/petrarch/petrarch/tests/test_petrarch.py test_nested/original