Lines Matching refs:resource
7 resource = support.import_module('resource') variable
14 self.assertRaises(TypeError, resource.getrlimit)
15 self.assertRaises(TypeError, resource.getrlimit, 42, 42)
16 self.assertRaises(TypeError, resource.setrlimit)
17 self.assertRaises(TypeError, resource.setrlimit, 42, 42, 42)
23 (cur, max) = resource.getrlimit(resource.RLIMIT_FSIZE)
32 self.assertEqual(resource.RLIM_INFINITY, max)
33 resource.setrlimit(resource.RLIMIT_FSIZE, (cur, max))
37 (cur, max) = resource.getrlimit(resource.RLIMIT_FSIZE)
50 resource.setrlimit(resource.RLIMIT_FSIZE, (1024, max))
74 resource.setrlimit(resource.RLIMIT_FSIZE, (cur, max))
79 resource.setrlimit(resource.RLIMIT_FSIZE, (cur, max))
86 (cur, max) = resource.getrlimit(resource.RLIMIT_FSIZE)
91 resource.setrlimit(resource.RLIMIT_FSIZE, (too_big, max))
95 resource.setrlimit(resource.RLIMIT_FSIZE, (max, too_big))
100 self.assertRaises(TypeError, resource.getrusage)
101 self.assertRaises(TypeError, resource.getrusage, 42, 42)
102 usageself = resource.getrusage(resource.RUSAGE_SELF)
103 usagechildren = resource.getrusage(resource.RUSAGE_CHILDREN)
106 usageboth = resource.getrusage(resource.RUSAGE_BOTH)
110 usage_thread = resource.getrusage(resource.RUSAGE_THREAD)
119 limits = resource.getrlimit(resource.RLIMIT_CPU)
131 resource.setrlimit(resource.RLIMIT_CPU, BadSequence())
134 pagesize = resource.getpagesize()
142 self.assertIsInstance(getattr(resource, 'RLIMIT_' + attr), int)
147 self.assertIsInstance(getattr(resource, 'RLIMIT_' + attr), int)
149 @unittest.skipUnless(hasattr(resource, 'prlimit'), 'no prlimit')
152 self.assertRaises(TypeError, resource.prlimit)
153 self.assertRaises(ProcessLookupError, resource.prlimit,
154 -1, resource.RLIMIT_AS)
155 limit = resource.getrlimit(resource.RLIMIT_AS)
156 self.assertEqual(resource.prlimit(0, resource.RLIMIT_AS), limit)
157 self.assertEqual(resource.prlimit(0, resource.RLIMIT_AS, limit),
161 @unittest.skipUnless(hasattr(resource, 'prlimit'), 'no prlimit')
170 limits = resource.getrlimit(resource.RLIMIT_AS)
171 self.assertEqual(resource.prlimit(0, resource.RLIMIT_AS, BadSeq()),