'Check that the dictionary is correctly adding and parsing short
sentence.'

def test_basic_parse(self):

    from parlai.core.dict import DictionaryAgent
    from parlai.core.params import ParlaiParser
    argparser = ParlaiParser()
    DictionaryAgent.add_cmdline_args(argparser)
    opt = argparser.parse_args()
    dictionary = DictionaryAgent(opt)
    num_builtin = len(dictionary)
    dictionary.observe({'text': 'hello    world'})
    dictionary.act()
    assert ((len(dictionary) - num_builtin) == 2)
    vec = dictionary.parse('hello    world')
    assert (len(vec) == 2)
    assert (vec[0] == num_builtin)
    assert (vec[1] == (num_builtin + 1))
    vec = dictionary.parse('hello    world', vec_type=list)
    assert (len(vec) == 2)
    assert (vec[0] == num_builtin)
    assert (vec[1] == (num_builtin + 1))
    vec = dictionary.parse('hello    world', vec_type=tuple)
    assert (len(vec) == 2)
    assert (vec[0] == num_builtin)
    assert (vec[1] == (num_builtin + 1))
