def test_apply_patch(self): patch = Document.from_string("foo", """<document><patch document="example"></patch></document>""").patches[0] docs = patch.apply({}) assert len(docs.keys()) == 1 assert docs.keys()[0] == 'example'
def test_loading_document_from_string(self): doc = Document.from_string("foo", """<document></document>""") assert isinstance(doc, Document)