def test_GenerateXML(self):

        server = Session("www.example.com")
        request = Lock(server, "/", headers.Depth0, Lock.eExclusive, "*****@*****.**", -1)
        os = StringIO()
        request.generateXML(os)
        self.assertEqual(os.getvalue(), """<?xml version='1.0' encoding='utf-8'?>
<ns0:lockinfo xmlns:ns0="DAV:">
  <ns0:lockscope>
    <ns0:exclusive />
  </ns0:lockscope>
  <ns0:locktype>
    <ns0:write />
  </ns0:locktype>
  <ns0:owner>[email protected]</ns0:owner>
</ns0:lockinfo>
""".replace("\n", "\r\n")
)
    def test_GenerateXML(self):

        server = Session("www.example.com")
        request = Lock(server, "/", headers.Depth0, Lock.eExclusive,
                       "*****@*****.**", -1)
        os = StringIO()
        request.generateXML(os)
        self.assertEqual(
            os.getvalue(), """<?xml version='1.0' encoding='utf-8'?>
<ns0:lockinfo xmlns:ns0="DAV:">
  <ns0:lockscope>
    <ns0:exclusive />
  </ns0:lockscope>
  <ns0:locktype>
    <ns0:write />
  </ns0:locktype>
  <ns0:owner>[email protected]</ns0:owner>
</ns0:lockinfo>
""".replace("\n", "\r\n"))