def test_write(self):
        """
        Contents of the file referred to by a L{FilePath} can be written using
        L{FilePath.setContent}.
        """
        pathString = self.mktemp()
        path = filepath.FilePath(pathString)
        path.setContent(b"hello, world")
        with open(pathString, "rb") as fObj:
            contents = fObj.read()
        self.assertEqual(b"hello, world", contents)

        Contents of the file referred to by a L{FilePath} can be written using
        L{FilePath.setContent}.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_paths.py