⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.205
Server IP:
97.74.87.16
Server:
Linux 16.87.74.97.host.secureserver.net 5.14.0-503.38.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Apr 18 08:52:10 EDT 2025 x86_64
Server Software:
Apache
PHP Version:
8.2.28
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
opt
/
python38
/
lib
/
python3.8
/
distutils
/
tests
/
View File Name :
test_clean.py
"""Tests for distutils.command.clean.""" import os import unittest from distutils.command.clean import clean from distutils.tests import support from test.support import run_unittest class cleanTestCase(support.TempdirManager, support.LoggingSilencer, unittest.TestCase): def test_simple_run(self): pkg_dir, dist = self.create_dist() cmd = clean(dist) # let's add some elements clean should remove dirs = [(d, os.path.join(pkg_dir, d)) for d in ('build_temp', 'build_lib', 'bdist_base', 'build_scripts', 'build_base')] for name, path in dirs: os.mkdir(path) setattr(cmd, name, path) if name == 'build_base': continue for f in ('one', 'two', 'three'): self.write_file(os.path.join(path, f)) # let's run the command cmd.all = 1 cmd.ensure_finalized() cmd.run() # make sure the files where removed for name, path in dirs: self.assertFalse(os.path.exists(path), '%s was not removed' % path) # let's run the command again (should spit warnings but succeed) cmd.all = 1 cmd.ensure_finalized() cmd.run() def test_suite(): return unittest.makeSuite(cleanTestCase) if __name__ == "__main__": run_unittest(test_suite())