Exemplo n.º 1
0
 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()
Exemplo n.º 2
0
 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()
Exemplo n.º 3
0
 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
     )
Exemplo n.º 4
0
 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)