def _flagsSilentlyWithUnsolicitedDataTest(self, method, item):
        """
        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.
        """
        d = getattr(self.client, method)('3', ('\\Read', '\\Seen'), True)
        self.assertEqual(
            self.transport.value(),
            b'0001 STORE 3 ' + item + b' (\\Read \\Seen)\r\n')
        self.client.lineReceived(b'* 2 FETCH (FLAGS (\\Read \\Seen))')
        self.client.lineReceived(b'0001 OK STORE completed')
        self.assertEqual(self.successResultOf(d), {})
        self.assertEqual(self.client.flags, {2: ['\\Read', '\\Seen']})

        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.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/mail/test/test_imap.py