diff options
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_os.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py index 4cdc29d..b05bffc 100644 --- a/Lib/test/test_os.py +++ b/Lib/test/test_os.py @@ -334,6 +334,14 @@ class MakedirTests (unittest.TestCase): os.removedirs(path) +class DevNullTests (unittest.TestCase): + def test_devnull(self): + f = file(os.devnull, 'w') + f.write('hello') + f.close() + f = file(os.devnull, 'r') + assert f.read() == '' + f.close() def test_main(): test_support.run_unittest( @@ -342,6 +350,7 @@ def test_main(): EnvironTests, WalkTests, MakedirTests, + DevNullTests, ) if __name__ == "__main__": |