コード例 #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()
コード例 #2
0
ファイル: test_phys_pkg.py プロジェクト: scanny/python-pptx
 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()
コード例 #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)
コード例 #4
0
ファイル: test_phys_pkg.py プロジェクト: scanny/python-pptx
 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)