def it_can_be_closed(self, ZipFile_): # mockery ---------------------- zipf = ZipFile_.return_value zip_pkg_writer = _ZipPkgWriter(None) # exercise --------------------- zip_pkg_writer.close() # verify ----------------------- zipf.close.assert_called_once_with()
def it_opens_pkg_file_zip_on_construction(self, ZipFile_): pkg_file = Mock(name="pkg_file") _ZipPkgWriter(pkg_file) ZipFile_.assert_called_once_with(pkg_file, "w", compression=ZIP_DEFLATED)