Ensured that the archive module consistantly explicitly closed all files.

This commit is contained in:
Alex Gaynor 2012-08-15 02:53:40 -07:00
parent ca6015ca71
commit ea1e8b38b3
2 changed files with 21 additions and 3 deletions

View file

@ -27,12 +27,14 @@ class ArchiveTester(object):
os.chdir(self.old_cwd)
def test_extract_method(self):
Archive(self.archive).extract(self.tmpdir)
with Archive(self.archive) as archive:
archive.extract(self.tmpdir)
self.check_files(self.tmpdir)
def test_extract_method_no_to_path(self):
os.chdir(self.tmpdir)
Archive(self.archive_path).extract()
with Archive(self.archive_path) as archive:
archive.extract()
self.check_files(self.tmpdir)
def test_extract_function(self):