def test_child(self):
        """
        L{URL.child} appends a new path segment, but does not affect the query
        or fragment.
        """
        urlpath = URL.fromText(theurl)
        self.assertEqual("http://www.foo.com/a/nice/path/gong?zot=23&zut",
                          urlpath.child(u'gong').asText())
        self.assertEqual("http://www.foo.com/a/nice/path/gong%2F?zot=23&zut",
                          urlpath.child(u'gong/').asText())
        self.assertEqual(
            "http://www.foo.com/a/nice/path/gong%2Fdouble?zot=23&zut",
            urlpath.child(u'gong/double').asText()
        )
        self.assertEqual(
            "http://www.foo.com/a/nice/path/gong%2Fdouble%2F?zot=23&zut",
            urlpath.child(u'gong/double/').asText()
        )

        L{URL.child} appends a new path segment, but does not affect the query
        or fragment.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/python/test/test_url.py