Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
66262ab0
Commit
66262ab0
authored
Jan 20, 2007
by
Walter Dörwald
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add argument tests an calls of resource.getrusage().
parent
9fab9a7d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
Lib/test/test_resource.py
Lib/test/test_resource.py
+18
-0
No files found.
Lib/test/test_resource.py
View file @
66262ab0
...
@@ -7,6 +7,13 @@ import os, resource
...
@@ -7,6 +7,13 @@ import os, resource
# This test is checking a few specific problem spots with the resource module.
# This test is checking a few specific problem spots with the resource module.
class
ResourceTest
(
unittest
.
TestCase
):
class
ResourceTest
(
unittest
.
TestCase
):
def
test_args
(
self
):
self
.
assertRaises
(
TypeError
,
resource
.
getrlimit
)
self
.
assertRaises
(
TypeError
,
resource
.
getrlimit
,
42
,
42
)
self
.
assertRaises
(
TypeError
,
resource
.
setrlimit
)
self
.
assertRaises
(
TypeError
,
resource
.
setrlimit
,
42
,
42
,
42
)
def
test_fsize_ismax
(
self
):
def
test_fsize_ismax
(
self
):
try
:
try
:
...
@@ -71,6 +78,17 @@ class ResourceTest(unittest.TestCase):
...
@@ -71,6 +78,17 @@ class ResourceTest(unittest.TestCase):
except
(
OverflowError
,
ValueError
):
except
(
OverflowError
,
ValueError
):
pass
pass
def
test_getrusage
(
self
):
self
.
assertRaises
(
TypeError
,
resource
.
getrusage
)
self
.
assertRaises
(
TypeError
,
resource
.
getrusage
,
42
,
42
)
usageself
=
resource
.
getrusage
(
resource
.
RUSAGE_SELF
)
usagechildren
=
resource
.
getrusage
(
resource
.
RUSAGE_CHILDREN
)
# May not be available on all systems.
try
:
usageboth
=
resource
.
getrusage
(
resource
.
RUSAGE_BOTH
)
except
ValueError
:
pass
def
test_main
(
verbose
=
None
):
def
test_main
(
verbose
=
None
):
test_support
.
run_unittest
(
ResourceTest
)
test_support
.
run_unittest
(
ResourceTest
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment