Ejemplo n.º 1
0
    def test_zip_folder(self, make_zip_mock):
        zip_file_name = "name.zip"
        make_zip_mock.return_value = zip_file_name

        with self.make_temp_dir() as dirname:
            with zip_folder(dirname) as actual_zip_file_name:
                self.assertEqual(actual_zip_file_name, zip_file_name)

        make_zip_mock.assert_called_once_with(mock.ANY, dirname)
Ejemplo n.º 2
0
    def test_zip_folder(self, make_zip_mock):
        zip_file_name = "name.zip"
        make_zip_mock.return_value = zip_file_name

        with self.make_temp_dir() as dirname:
            with zip_folder(dirname) as actual_zip_file_name:
                self.assertEqual(actual_zip_file_name, zip_file_name)

        make_zip_mock.assert_called_once_with(mock.ANY, dirname)
Ejemplo n.º 3
0
    def test_zip_folder(self, make_zip_mock):
        my_zip_file_name = "some name"

        make_zip_mock.return_value = my_zip_file_name
        with self.make_temp_dir() as dirname:

            generator = zip_folder(dirname)
            self.assertEquals(generator.__enter__(), my_zip_file_name)

        make_zip_mock.assert_called_once_with(mock.ANY, dirname)