def test_siblingString(self):
        """
        Calling C{str()} with a C{URLPath.sibling()} will return a URL which is
        the sibling of the URL it was instantiated with.
        """
        self.assertEqual(str(self.path.sibling(b'baz')),
                         'http://example.com/foo/baz')
        self.assertEqual(str(self.path.sibling(b'baz', keepQuery=True)),
                         "http://example.com/foo/baz?yes=no&no=yes")

        # The sibling of http://example.com/foo/bar/
        #     is http://example.comf/foo/bar/baz
        # because really we are constructing a sibling of
        # http://example.com/foo/bar/index.html
        self.assertEqual(str(self.path.child(b'').sibling(b'baz')),
                         'http://example.com/foo/bar/baz')

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