Пример #1
0
    def test_invalid_option(self):
        support.patch(self, sys, "argv", [sys.executable, "--invalid"])
        with support.captured_stdout() as output:
            with self.assertRaises(SystemExit) as cm:
                mimetypes._main()

        self.assertIn("Usage: mimetypes.py", output.getvalue())
        self.assertEqual(cm.exception.code, 1)
Пример #2
0
 def mimetypes_cmd(self, *args, **kwargs):
     support.patch(self, sys, "argv", [sys.executable, *args])
     with support.captured_stdout() as output:
         mimetypes._main()
         return output.getvalue().strip()
Пример #3
0
 def update_event(self, inp=-1):
     self.set_output_val(0, mimetypes._main())