Lines Matching defs:test
4 import test.support
7 from test.support import os_helper
8 from test.support import warnings_helper
15 MAILCAPFILE = test.support.findfile("mailcap.txt")
17 # Dict to act as mock mailcap entry for this test
50 [{'test': 'test "`echo %{charset} | tr \'[A-Z]\' \'[a-z]\'`" = iso-8859-8',
96 # Test readmailcapfile() using test file. It should match MAILCAPDICT.
126 # test case: ([field, MIMEtype, filename, plist=[]], <expected string>)
159 # At least 1 mailcap file exists, so test that.
195 # test case: (findmatch args, findmatch keyword args, expected output)
226 @unittest.skipUnless(os.name == "posix", "Requires 'test' command on system")
227 @unittest.skipIf(sys.platform == "vxworks", "'test' command is not supported on VxWorks")
229 test.support.has_subprocess_support,
230 "'test' command needs process support."
233 # findmatch() will automatically check any "test" conditions and skip
235 caps = {"test/pass": [{"test": "test 1 -eq 1"}],
236 "test/fail": [{"test": "test 1 -eq 0"}]}
237 # test case: (findmatch args, findmatch keyword args, expected output)
238 # positional args: caps, MIMEtype, key ("test")
242 # findmatch will return the mailcap entry for test/pass because it evaluates to true
243 ([caps, "test/pass", "test"], {}, ("test 1 -eq 1", {"test": "test 1 -eq 1"})),
244 # findmatch will return None because test/fail evaluates to false
245 ([caps, "test/fail", "test"], {}, (None, None))