Download tests/unit/test_exceptions.py from Openyx/xcdv: direct link, hf CLI and curl.
- Browser
- Download file 1.29 kB
-
https://huggingface.co/spaces/Openyx/xcdv/resolve/main/tests/unit/test_exceptions.py
- Command line
-
hf download hf://spaces/Openyx/xcdv/tests/unit/test_exceptions.py
-
curl -L -o test_exceptions.py https://huggingface.co/spaces/Openyx/xcdv/resolve/main/tests/unit/test_exceptions.py
1.29 kB
| # SPDX-License-Identifier: AGPL-3.0-or-later | |
| # pylint: disable=missing-module-docstring,disable=missing-class-docstring,invalid-name | |
| from parameterized import parameterized | |
| from tests import SearxTestCase | |
| import searx.exceptions | |
| from searx import get_setting | |
| class TestExceptions(SearxTestCase): | |
| def test_default_suspend_time(self, exception): | |
| with self.assertRaises(exception) as e: | |
| raise exception() | |
| self.assertEqual( | |
| e.exception.suspended_time, | |
| get_setting(exception.SUSPEND_TIME_SETTING), | |
| ) | |
| def test_custom_suspend_time(self, exception): | |
| with self.assertRaises(exception) as e: | |
| raise exception(suspended_time=1337) | |
| self.assertEqual(e.exception.suspended_time, 1337) | |