'Test setting and getting of CORS XML documents with storage_uri.'

def test_cors_xml_storage_uri(self):

    bucket = self._MakeBucket()
    bucket_name = bucket.name
    uri = storage_uri(('gs://' + bucket_name))
    cors = re.sub('\\s', '', uri.get_cors().to_xml())
    self.assertEqual(cors, CORS_EMPTY)
    cors_obj = Cors()
    h = handler.XmlHandler(cors_obj, None)
    xml.sax.parseString(CORS_DOC, h)
    uri.set_cors(cors_obj)
    cors = re.sub('\\s', '', uri.get_cors().to_xml())
    self.assertEqual(cors, CORS_DOC)
