def test_file(self):
        """
        Test the correctness of the coerce function.
        """
        arg = formmethod.File("name", allowNone=0)
        self.assertEqual(arg.coerce("something"), "something")
        self.assertRaises(formmethod.InputError, arg.coerce, None)
        arg2 = formmethod.File("name")
        self.assertIsNone(arg2.coerce(None))

        Test the correctness of the coerce function.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_formmethod.py