'Test we can add some ``Cross-origin resource sharing`` headers
to the request about to be sent.'

def test_upload_object_via_stream_with_cors_headers(self):

    cors_headers = {'Access-Control-Allow-Origin': 'http://mozilla.com', 'Origin': 'http://storage.clouddrive.com'}
    expected_headers = {'Content-Type': 'application/octet-stream'}
    expected_headers.update(cors_headers)
    def intercept_request(request_path, method=None, data=None, headers=None, raw=True):
        self.assertDictEqual(expected_headers, headers)
        raise NotImplementedError('oops')
    self.driver.connection.request = intercept_request
    container = Container(name='CORS', extra={}, driver=self.driver)
    try:
        self.driver.upload_object_via_stream(iterator=iter('blob    data    like    an    image    or    video'), container=container, object_name='test_object', headers=cors_headers)
    except NotImplementedError:
        pass
    else:
        self.fail('Expected    NotImplementedError    to    be    thrown    to    verify    we    actually    checked    the    expected    headers')
