'Test unsolicited data received in response to a silent flag modifying
method.  Call the method, assert that the correct bytes are sent,
deliver the unsolicited I{FETCH} response, and assert that the result
of the Deferred returned by the method is correct.
@param method: The name of the method to test.
@param item: The data item which is expected to be specified.'

def _flagsSilentlyWithUnsolicitedDataTest(self, method, item):

    d = getattr(self.client, method)('3', ('\\Read', '\\Seen'), True)
    self.assertEqual(self.transport.value(), (('0001    STORE    3    ' + item) + '    (\\Read    \\Seen)\r\n'))
    self.client.lineReceived('*    2    FETCH    (FLAGS    (\\Read    \\Seen))')
    self.client.lineReceived('0001    OK    STORE    completed')
    self.assertEqual(self._extractDeferredResult(d), {})
    self.assertEqual(self.client.flags, {2: ['\\Read', '\\Seen']})
