def test_asBytesModeFromUnicodeWithEncoding(self):
        """
        C{asBytesMode} with an C{encoding} argument uses that encoding when
        coercing the L{unicode}-mode L{FilePath} to a L{bytes}-mode L{FilePath}.
        """
        fp = filepath.FilePath(u"\u2603")
        newfp = fp.asBytesMode(encoding="utf-8")
        self.assertIn(b"\xe2\x98\x83", newfp.path)

        C{asBytesMode} with an C{encoding} argument uses that encoding when
        coercing the L{unicode}-mode L{FilePath} to a L{bytes}-mode L{FilePath}.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_paths.py