File: pil_test.py

package info (click to toggle)
thumbor 7.7.7-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 40,556 kB
  • sloc: xml: 295,435; python: 18,673; ansic: 1,479; makefile: 360; sh: 27
file content (31 lines) | stat: -rw-r--r-- 861 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from os.path import join

from tornado.testing import gen_test

from . import EngineCase
from .urls_helpers import MAX_DATASET_SIZE, UrlsTester, single_dataset


class PILTest(EngineCase):
    engine = "thumbor.engines.pil"

    @gen_test(timeout=MAX_DATASET_SIZE * 5)
    async def test_single_params(self):
        if not self._app:
            return True
        group = list(single_dataset())
        count = len(group)
        tester = UrlsTester(self.http_client)

        print("Requests count: %d" % count)
        for options in group:
            joined_parts = join(*options)
            url = "unsafe/%s" % joined_parts
            await tester.try_url(self.get_url(f"/{url}"))

        tester.report()

    # def test_combined_params__with_pil(self):
    #     if not self._app:
    #         return True
    #     combined_dataset(self.retrieve)