def test_parentString(self):
        """
        Calling C{str()} with a C{URLPath.parent()} will return a URL which is
        the parent of the URL it was instantiated with.
        """
        # .parent() should be equivalent to '..'
        # 'foo' is the current directory, '/' is the parent directory
        self.assertEqual(str(self.path.parent()),
                         'http://example.com/')
        self.assertEqual(str(self.path.parent(keepQuery=True)),
                         'http://example.com/?yes=no&no=yes')
        self.assertEqual(str(self.path.child(b'').parent()),
                         'http://example.com/foo/')
        self.assertEqual(str(self.path.child(b'baz').parent()),
                         'http://example.com/foo/')
        self.assertEqual(
            str(self.path.parent().parent().parent().parent().parent()),
            'http://example.com/')

        Calling C{str()} with a C{URLPath.parent()} will return a URL which is
        the parent of the URL it was instantiated with.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/python/test/test_urlpath.py