def test__deploy_zapp_container_doesnt_exist(self):
        self.conn.get_container.side_effect = (
            swiftclient.exceptions.ClientException(None)
        )

        with mock.patch('zpmlib.zpm._generate_uploads') as gu:
            gu.return_value = iter([('target/dir/foo.py', 'data', None)])
            zpm._deploy_zapp(self.conn, 'target/dir', None, None)

            # check that the container is created
            assert self.conn.put_container.call_count == 1
            assert self.conn.put_container.call_args_list == [
                mock.call('target')
            ]
            # check that files are uploaded correctly
            assert self.conn.put_object.call_count == 1
            assert self.conn.put_object.call_args_list == [
                mock.call('target', 'dir/foo.py', 'data', content_type=None)
            ]