def test_copy(self):
        """
        L{Headers.copy} creates a new independent copy of an existing
        L{Headers} instance, allowing future modifications without impacts
        between the copies.
        """
        h = Headers()
        h.setRawHeaders(u'test\u00E1', [u'foo\u2603'])
        i = h.copy()

        # The copy contains the same value as the original
        self.assertEqual(i.getRawHeaders(u'test\u00E1'), [u'foo\u2603'])
        self.assertEqual(i.getRawHeaders(b'test\xe1'), [b'foo\xe2\x98\x83'])

        # Add a header to the original
        h.addRawHeader(u'test\u00E1', u'bar')

        # Verify that the copy has not changed
        self.assertEqual(i.getRawHeaders(u'test\u00E1'), [u'foo\u2603'])
        self.assertEqual(i.getRawHeaders(b'test\xe1'), [b'foo\xe2\x98\x83'])

        # Add a header to the copy
        i.addRawHeader(u'test\u00E1', b'baz')

        # Verify that the orignal does not have it
        self.assertEqual(
            h.getRawHeaders(u'test\u00E1'), [u'foo\u2603', u'bar'])
        self.assertEqual(
            h.getRawHeaders(b'test\xe1'), [b'foo\xe2\x98\x83', b'bar'])

        L{Headers.copy} creates a new independent copy of an existing
        L{Headers} instance, allowing future modifications without impacts
        between the copies.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/test/test_http_headers.py