def test_click(self):
        """
        L{URL.click} interprets the given string as a relative URI-reference
        and returns a new L{URL} interpreting C{self} as the base absolute URI.
        """
        urlpath = URL.from_text(BASIC_URL)
        # A null uri should be valid (return here).
        self.assertEqual("http://www.foo.com/a/nice/path/?zot=23&zut",
                          urlpath.click("").to_text())
        # A simple relative path remove the query.
        self.assertEqual("http://www.foo.com/a/nice/path/click",
                          urlpath.click("click").to_text())
        # An absolute path replace path and query.
        self.assertEqual("http://www.foo.com/click",
                          urlpath.click("/click").to_text())
        # Replace just the query.
        self.assertEqual("http://www.foo.com/a/nice/path/?burp",
                          urlpath.click("?burp").to_text())
        # One full url to another should not generate '//' between authority.
        # and path
        self.assertTrue("//foobar" not in
                        urlpath.click('http://www.foo.com/foobar').to_text())

        # From a url with no query clicking a url with a query, the query
        # should be handled properly.
        u = URL.from_text('http://www.foo.com/me/noquery')
        self.assertEqual('http://www.foo.com/me/17?spam=158',
                         u.click('/me/17?spam=158').to_text())

        # Check that everything from the path onward is removed when the click
        # link has no path.
        u = URL.from_text('http://localhost/foo?abc=def')
        self.assertEqual(u.click('http://www.python.org').to_text(),
                         'http://www.python.org')

        # https://twistedmatrix.com/trac/ticket/8184
        u = URL.from_text('http://hatnote.com/a/b/../c/./d/e/..')
        res = 'http://hatnote.com/a/c/d/'
        self.assertEqual(u.click('').to_text(), res)

        # test click default arg is same as empty string above
        self.assertEqual(u.click().to_text(), res)

        # test click on a URL instance
        u = URL.fromText('http://localhost/foo/?abc=def')
        u2 = URL.from_text('bar')
        u3 = u.click(u2)
        self.assertEqual(u3.to_text(), 'http://localhost/foo/bar')

        L{URL.click} interprets the given string as a relative URI-reference
        and returns a new L{URL} interpreting C{self} as the base absolute URI.
        
stackoverflow/venv/lib/python3.6/site-packages/hyperlink/test/test_url.py