diff options
Diffstat (limited to 'tests/test_exceptions.py')
| -rw-r--r-- | tests/test_exceptions.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/test_exceptions.py b/tests/test_exceptions.py index becf107..3e3dc9f 100644 --- a/tests/test_exceptions.py +++ b/tests/test_exceptions.py | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | import adblock | 1 | import adblock |
| 2 | 2 | import pytest | |
| 3 | 3 | ||
| 4 | def test_correct_baseclasses(): | 4 | def test_correct_baseclasses(): |
| 5 | assert issubclass(adblock.AdblockException, Exception) | 5 | assert issubclass(adblock.AdblockException, Exception) |
| @@ -9,3 +9,14 @@ def test_correct_baseclasses(): | |||
| 9 | assert issubclass(adblock.OptimizedFilterExistence, adblock.BlockerException) | 9 | assert issubclass(adblock.OptimizedFilterExistence, adblock.BlockerException) |
| 10 | assert issubclass(adblock.BadFilterAddUnsupported, adblock.BlockerException) | 10 | assert issubclass(adblock.BadFilterAddUnsupported, adblock.BlockerException) |
| 11 | assert issubclass(adblock.FilterExists, adblock.BlockerException) | 11 | assert issubclass(adblock.FilterExists, adblock.BlockerException) |
| 12 | assert issubclass(adblock.AddResourceError, adblock.BlockerException) | ||
| 13 | |||
| 14 | |||
| 15 | def test_add_resource_error(): | ||
| 16 | filter_set = adblock.FilterSet() | ||
| 17 | engine = adblock.Engine(filter_set=filter_set) | ||
| 18 | |||
| 19 | with pytest.raises(adblock.AddResourceError) as exc: | ||
| 20 | engine.add_resource(name='aa', content_type="image/jpeg", content="111") | ||
| 21 | |||
| 22 | assert "invalid base64 content" in str(exc.value) | ||
