[PATCH 3 of 4] [test] add test for BFSS to S3 migration

Denis Laxalde denis.laxalde at logilab.fr
Fri Sep 20 15:05:45 CEST 2019


> diff -r 84fa38051760 -r bacb587fcac6 test/data/hooks.py
> --- a/test/data/hooks.py	Thu Sep 19 18:10:51 2019 +0200
> +++ b/test/data/hooks.py	Fri Sep 20 14:37:00 2019 +0200

> @@ -10,3 +12,8 @@
>    def __call__(self):
>        storage = S3Storage('test-bucket')
>        self.repo.system_source.set_storage('Image', 'data', storage)
> +      #with tempfile.TemporaryDirectory() as tmpdirname:
> +      storages.set_attribute_storage(
> +            self.repo, 'Image', 'thumbnail_on_bfss',
> +            storages.BytesFileSystemStorage(tempfile.mkdtemp()))
> +      # TODO - find a way to cleanup tmpdir

I think you can use test/data/bfss as a temporary directory (and then
have it hg-ignored). IIRC, that's how it's done in cubicweb's tests.



More information about the cubicweb-devel mailing list