def test_invalidRanges(self):
        """
        L{File._parseRangeHeader} raises L{ValueError} when passed
        syntactically invalid byte ranges.
        """
        f = self.resource._parseRangeHeader

        # there's no =
        self.assertRaises(ValueError, f, b'bytes')

        # unknown isn't a valid Bytes-Unit
        self.assertRaises(ValueError, f, b'unknown=1-2')

        # there's no - in =stuff
        self.assertRaises(ValueError, f, b'bytes=3')

        # both start and end are empty
        self.assertRaises(ValueError, f, b'bytes=-')

        # start isn't an integer
        self.assertRaises(ValueError, f, b'bytes=foo-')

        # end isn't an integer
        self.assertRaises(ValueError, f, b'bytes=-foo')

        # end isn't equal to or greater than start
        self.assertRaises(ValueError, f, b'bytes=5-4')

        L{File._parseRangeHeader} raises L{ValueError} when passed
        syntactically invalid byte ranges.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/test/test_static.py