diff options
author | Berker Peksag <berker.peksag@gmail.com> | 2014-11-01 09:04:06 (GMT) |
---|---|---|
committer | Berker Peksag <berker.peksag@gmail.com> | 2014-11-01 09:04:06 (GMT) |
commit | 8083cd6c3bd8970de4bb592a0973169733f32b94 (patch) | |
tree | 79071c1f55e52ded513fd8cbb99a29845bf62368 /Lib/test/test_shutil.py | |
parent | e1d26f377eb911aa6a6c5f666ba9c71c65b85695 (diff) | |
download | cpython-8083cd6c3bd8970de4bb592a0973169733f32b94.zip cpython-8083cd6c3bd8970de4bb592a0973169733f32b94.tar.gz cpython-8083cd6c3bd8970de4bb592a0973169733f32b94.tar.bz2 |
Issue #22665: Add missing get_terminal_size and SameFileError to shutil.__all__.
Diffstat (limited to 'Lib/test/test_shutil.py')
-rw-r--r-- | Lib/test/test_shutil.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py index 66b3fb1..c4306da 100644 --- a/Lib/test/test_shutil.py +++ b/Lib/test/test_shutil.py @@ -1762,5 +1762,23 @@ class TermsizeTests(unittest.TestCase): self.assertEqual(expected, actual) +class PublicAPITests(unittest.TestCase): + """Ensures that the correct values are exposed in the public API.""" + + def test_module_all_attribute(self): + self.assertTrue(hasattr(shutil, '__all__')) + target_api = ['copyfileobj', 'copyfile', 'copymode', 'copystat', + 'copy', 'copy2', 'copytree', 'move', 'rmtree', 'Error', + 'SpecialFileError', 'ExecError', 'make_archive', + 'get_archive_formats', 'register_archive_format', + 'unregister_archive_format', 'get_unpack_formats', + 'register_unpack_format', 'unregister_unpack_format', + 'unpack_archive', 'ignore_patterns', 'chown', 'which', + 'get_terminal_size', 'SameFileError'] + if hasattr(os, 'statvfs') or os.name == 'nt': + target_api.append('disk_usage') + self.assertEqual(set(shutil.__all__), set(target_api)) + + if __name__ == '__main__': unittest.main() |