示例#1
0
 def test_early_failure(self):
     """ Fail early when passed the wrong XML. """
     bad_xml = '''<?xml version="1.0" encoding="utf-8" ?>
         <WrongRootElement>
         <UserName>Bob</UserName>
         </WrongRootElement>
     '''
     with self.assertRaises(ValueError):
         envelopes.CompletedEnvelope(bad_xml)
示例#2
0
 def test_root_element_okay(self):  # pylint: disable=no-self-use
     """ No errors occur when initializing the right root element type. """
     valid_xml = '''<?xml version="1.0" encoding="utf-8" ?>
         <DocuSignEnvelopeInformation xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                                      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                                      xmlns="http://www.docusign.net/API/3.0">
           <EnvelopeStatus></EnvelopeStatus>
         </DocuSignEnvelopeInformation>
     '''
     envelopes.CompletedEnvelope(valid_xml)
示例#3
0
def load_envelope(filename='completed_waiver.xml'):
    example_xml = dir_path / filename
    return envelopes.CompletedEnvelope(example_xml.open().read())
示例#4
0
 def load_envelope(self, filename='completed_waiver.xml'):
     example_xml = dir_path / filename
     self.env = envelopes.CompletedEnvelope(example_xml.open().read())