def test__deploy_zapp_container_not_empty(self):
        self.conn.get_container.return_value = (
            {},  # response headers
            # The actual files list response from Swift is a list of
            # dictionaries. For these tests, we don't actually check the
            # content; just length of the file list.
            ['file1'],
        )

        with pytest.raises(zpmlib.ZPMException) as exc:
            zpm._deploy_zapp(self.conn, 'target/dir1/dir2', None, None)

        assert str(exc.value) == (
            "Target container ('target') is not empty.\n"
            "Deploying to a non-empty container can cause consistency "
            "problems with overwritten objects.\n"
            "Specify the flag `--force/-f` to overwrite anyway."
        )
        assert self.conn.get_container.call_args_list == [mock.call('target')]