def test_mustBeBytes(self):
        """
        L{URLPath.fromBytes} must take a L{bytes} argument.
        """
        with self.assertRaises(ValueError):
            urlpath.URLPath.fromBytes(None)

        with self.assertRaises(ValueError):
            urlpath.URLPath.fromBytes(u"someurl")

        L{URLPath.fromBytes} must take a L{bytes} argument.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/python/test/test_urlpath.py