diff options
| author | Árni Dagur <arni@dagur.eu> | 2022-07-17 22:47:05 +0200 |
|---|---|---|
| committer | Árni Dagur <arni@dagur.eu> | 2022-07-18 00:12:16 +0200 |
| commit | 3fcd327a63ae331e641565db0e178a9a64b4b0dd (patch) | |
| tree | a80e19fe3ba4097a89ebd3a58681faacfe68962e /tests | |
| parent | 83a211f741fc7de635181af71f7074ccce852aa8 (diff) | |
Update Rust dependencies
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_redirect.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/tests/test_redirect.py b/tests/test_redirect.py index cca3a91..7782df8 100644 --- a/tests/test_redirect.py +++ b/tests/test_redirect.py | |||
| @@ -35,11 +35,11 @@ def test_redirect_url_is_not_recognized_without_include_redirect_urls(): | |||
| 35 | def test_redirect_url_exception(): | 35 | def test_redirect_url_exception(): |
| 36 | # https://github.com/brave/adblock-rust/blob/b7f29af8c0a0d000201d8d769b6a0b25a9dd4e89/src/blocker.rs#L1314 | 36 | # https://github.com/brave/adblock-rust/blob/b7f29af8c0a0d000201d8d769b6a0b25a9dd4e89/src/blocker.rs#L1314 |
| 37 | filter_set = adblock.FilterSet(debug=True) | 37 | filter_set = adblock.FilterSet(debug=True) |
| 38 | filter_set.add_filter_list( | 38 | filter_set.add_filters( |
| 39 | """ | 39 | [ |
| 40 | ||imdb-video.media-imdb.com$media,redirect-url=http://xyz.com | 40 | "||imdb-video.media-imdb.com$media,redirect-url=http://xyz.com", |
| 41 | @@||imdb-video.media-imdb.com^$domain=imdb.com | 41 | "@@||imdb-video.media-imdb.com^$domain=imdb.com", |
| 42 | """, | 42 | ], |
| 43 | include_redirect_urls=True, | 43 | include_redirect_urls=True, |
| 44 | ) | 44 | ) |
| 45 | 45 | ||
| @@ -50,10 +50,11 @@ def test_redirect_url_exception(): | |||
| 50 | "https://www.imdb.com/video/13", | 50 | "https://www.imdb.com/video/13", |
| 51 | "media", | 51 | "media", |
| 52 | ) | 52 | ) |
| 53 | assert res.error is None | ||
| 53 | assert res.matched is False | 54 | assert res.matched is False |
| 54 | assert res.redirect == "http://xyz.com" | 55 | assert res.redirect == "http://xyz.com" |
| 55 | assert res.redirect_type == "url" | 56 | assert res.redirect_type == "url" |
| 56 | assert res.exception == "@@||imdb-video.media-imdb.com^$domain=imdb.com" | 57 | assert res.exception is None |
| 57 | 58 | ||
| 58 | 59 | ||
| 59 | def test_redirect_with_custom_resource(): | 60 | def test_redirect_with_custom_resource(): |
