def test_document_dict_to_pb(json_dict): orig_text = 'Belgian swimmers beat the United States. Really?' doc = AnnotatedDocument.json_to_pb(json_dict) assert doc.text == orig_text assert doc.sentence[1].text == 'Really?'