'Check that L{filetransfer.FileTransferClient.openFile} can send
extended attributes, that should be extracted server side. By default,
they are ignored, so we just verify they are correctly parsed.'

def test_openFileExtendedAttributes(self):

    savedAttributes = {}
    oldOpenFile = self.server.client.openFile
    def openFile(filename, flags, attrs):
        savedAttributes.update(attrs)
        return oldOpenFile(filename, flags, attrs)
    self.server.client.openFile = openFile
    d = self.client.openFile('testfile1', (filetransfer.FXF_READ | filetransfer.FXF_WRITE), {'ext_foo': 'bar'})
    self._emptyBuffers()
    def check(ign):
        self.assertEqual(savedAttributes, {'ext_foo': 'bar'})
    return d.addCallback(check)
