Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
vivodi committed Jan 17, 2025
1 parent a3d2d00 commit 2e96d9e
Show file tree
Hide file tree
Showing 18 changed files with 42 additions and 42 deletions.
4 changes: 2 additions & 2 deletions flexget/terminal.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def rule(
|
""",
""", # noqa: W291, W293
ascii=True,
)

Expand All @@ -97,7 +97,7 @@ def rule(
|-||
| ||
""",
""", # noqa: W293
ascii=True,
)

Expand Down
4 changes: 2 additions & 2 deletions flexget/tests/test_asciify.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ class TestAsciifyFilter:
asscify_me:
mock:
- {"title":"[My](Tìtlê)-ìs a' me^ss", "url":"mock://local" }
accept_all: yes
set:
title1: "{{title|asciify|replace('is','is still')}}"
title2: "{{title|strip_symbols|replace('ìs','ìs still')}}"
Expand Down
4 changes: 2 additions & 2 deletions flexget/tests/test_content_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class TestContentFilter:
accept_all: yes
content_filter:
reject: ['*.iso']
test_min_files:
max_reruns: 0
mock:
Expand All @@ -77,7 +77,7 @@ class TestContentFilter:
accept_all: yes
content_filter:
min_files: 4
test_max_files:
max_reruns: 0
mock:
Expand Down
2 changes: 1 addition & 1 deletion flexget/tests/test_discover.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ class TestEmitSeriesInDiscover:
begin: s02e01
identified_by: ep
season_packs: yes
max_reruns: 0
max_reruns: 0
"""

def test_next_series_episodes_rerun(self, execute_task):
Expand Down
6 changes: 3 additions & 3 deletions flexget/tests/test_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,12 @@ class TestDownloadAuth:
download:
path: __tmp__
temp: __tmp__
tasks:
no_auth:
template:
- download
with_auth:
template:
- download
Expand All @@ -162,7 +162,7 @@ class TestDownloadAuth:
type: digest
- basic-auth:
username: user
password: passwd
password: passwd
"""

def test_download_auth(self, execute_task):
Expand Down
2 changes: 1 addition & 1 deletion flexget/tests/test_manipulate.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class TestManipulate:
- {title: 'abc', description: 'def'}
manipulate:
- description: { remove: yes }
test_replace_with_group:
mock:
- {title: '1234-7890'}
Expand Down
6 changes: 3 additions & 3 deletions flexget/tests/test_pending_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ class TestListInterface:
pending_list:
list_name: 'test_list'
include: 'pending'
list_get_approved:
pending_list:
list_name: 'test_list'
include: 'approved'
list_get_all:
pending_list:
list_name: 'test_list'
include: 'all'
pending_list_add:
mock:
- {title: 'title 1', url: "http://mock.url/file1.torrent"}
Expand Down
2 changes: 1 addition & 1 deletion flexget/tests/test_plex_watchlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class TestPlex:
password: {PLEX_PASSWORD}
tasks:
plex_watchlist:
plex_watchlist:
plex_watchlist:
<<: *plex_def
accept_all: true
test_list_add:
Expand Down
6 changes: 3 additions & 3 deletions flexget/tests/test_radarr_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ class TestRadarrListActions:
api_key: {RADARR_API_KEY}
port: {RADARR_PORT}
tags: ["movies", "othertag"]
radarr_list_as_input_plugin:
radarr_list:
base_url: {RADARR_BASE_URL}
api_key: {RADARR_API_KEY}
port: {RADARR_PORT}
include_data: True
accept_all: yes
remove_from_radarr_list:
mock:
- {{ title: "Ocean\'s Twelve (2004)", imdb_id: 'tt0349903', tmdb_id: 163 }}
Expand All @@ -71,7 +71,7 @@ class TestRadarrListActions:
base_url: {RADARR_BASE_URL}
api_key: {RADARR_API_KEY}
port: {RADARR_PORT}
match_radarr_list:
mock:
- {{ title: 'Despicable.Me.2.2013.1080p.BluRay.x264-FlexGet', imdb_id: 'tt1690953', tmdb_id: 93456 }}
Expand Down
2 changes: 1 addition & 1 deletion flexget/tests/test_regexp.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class TestRegexp:
reject:
- reject
rest: reject
test_only_rest:
regexp:
rest: reject
Expand Down
10 changes: 5 additions & 5 deletions flexget/tests/test_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ class TestFilterSeries:
parsing:
series: {{parser}}
tasks:
test:
mock:
- {title: 'Some.Series.S01E20.720p.XViD-FlexGet'}
Expand Down Expand Up @@ -1829,13 +1829,13 @@ class TestSpecials:
series:
- the show:
assume_special: False
special_looks_like_season_pack:
mock:
- title: Doctor.Who.S07.Special.The.Science.of.Doctor.Who.WS.XviD-Flexget
series:
- Doctor Who
"""

def test_prefer_specials(self, execute_task):
Expand Down Expand Up @@ -2154,7 +2154,7 @@ class TestSeriesSeasonPack:
test_with_dict_config_2:
mock:
- title: bro.s02.720p.HDTV-Flexget
"""

@pytest.fixture()
Expand Down Expand Up @@ -2301,7 +2301,7 @@ class TestSeriesSeasonPackAdvanced:
identified_by: ep
quality: 720p|1080p webrip+
timeframe: 4 hours
target: 720p webrip+ h264+
target: 720p webrip+ h264+
season_packs: true
"""

Expand Down
2 changes: 1 addition & 1 deletion flexget/tests/test_sftp_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class TestSftpList:
<<: *sftp_basic_auth
dirs:
- '/downloads'
sftp_list_recursive_true:
sftp_list:
<<: *base_sftp_list
Expand Down
6 changes: 3 additions & 3 deletions flexget/tests/test_sonarr_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ class TestSonarrListActions:
api_key: {SONARR_API_KEY}
port: {SONARRR_PORT}
tags: ["tv", "othertag"]
sonarr_list_as_input_plugin:
sonarr_list:
base_url: {SONARR_BASE_URL}
api_key: {SONARR_API_KEY}
port: {SONARRR_PORT}
include_data: True
accept_all: yes
remove_from_sonarr_list:
mock:
- {{ title: 'Breaking Bad', imdb_id: 'tt0903747', tvdb_id: 81189 }}
Expand All @@ -70,7 +70,7 @@ class TestSonarrListActions:
base_url: {SONARR_BASE_URL}
api_key: {SONARR_API_KEY}
port: {SONARRR_PORT}
match_sonarr_list:
mock:
- {{ title: 'Game.Of.Thrones.S01E01.1080p.BluRay.x264-FlexGet', imdb_id: 'tt0944947', tvdb_id: 121361 }}
Expand Down
12 changes: 6 additions & 6 deletions flexget/tests/test_timeframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,30 +23,30 @@ class TestTimeFrame:
target: 1080p
mock:
- {title: 'Movie.BRRip.x264.720p', 'media_id': 'Movie'}
- {title: 'Movie.720p WEB-DL X264 AC3', 'media_id': 'Movie'}
- {title: 'Movie.720p WEB-DL X264 AC3', 'media_id': 'Movie'}
reached_and_backlog:
timeframe:
wait: 1 hour
target: 1080p
on_reached: accept
mock:
- {title: 'Movie.720p WEB-DL X264 AC3', 'media_id': 'Movie'}
- {title: 'Movie.720p WEB-DL X264 AC3', 'media_id': 'Movie'}
- {title: 'Movie.BRRip.x264.720p', 'media_id': 'Movie'}
target1:
timeframe:
wait: 1 hour
target: 1080p
on_reached: accept
mock:
- {title: 'Movie.720p WEB-DL X264 AC3', 'media_id': 'Movie'}
- {title: 'Movie.720p WEB-DL X264 AC3', 'media_id': 'Movie'}
- {title: 'Movie.BRRip.x264.720p', 'media_id': 'Movie'}
target2:
timeframe:
wait: 1 hour
target: 1080p
on_reached: accept
mock:
- {title: 'Movie.1080p WEB-DL X264 AC3', 'media_id': 'Movie'}
- {title: 'Movie.1080p WEB-DL X264 AC3', 'media_id': 'Movie'}
"""

def test_wait(self, execute_task):
Expand Down Expand Up @@ -99,14 +99,14 @@ class TestTimeFrameActions:
on_waiting: reject
mock:
- {title: 'Movie.BRRip.x264.720p', 'id': 'Movie'}
- {title: 'Movie.720p WEB-DL X264 AC3', 'id': 'Movie'}
- {title: 'Movie.720p WEB-DL X264 AC3', 'id': 'Movie'}
reached_accept:
timeframe:
wait: 1 hour
target: 1080p
on_reached: accept
mock:
- {title: 'Movie.720p WEB-DL X264 AC3', 'id': 'Movie'}
- {title: 'Movie.720p WEB-DL X264 AC3', 'id': 'Movie'}
- {title: 'Movie.BRRip.x264.720p', 'id': 'Movie'}
"""

Expand Down
2 changes: 1 addition & 1 deletion flexget/tests/test_trakt.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ class TestTraktWatchedAndCollected:
username: flexgettest
mock:
- title: aoetaraeha aeotrae taetaeor
"""

def test_trakt_watched_lookup(self, execute_task):
Expand Down
2 changes: 1 addition & 1 deletion flexget/tests/test_upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class TestUpgrade:
upgrade:
tracking: yes
mock:
- {title: 'Movie.1080p WEB-DL X264 AC3', 'media_id': 'Movie'}
- {title: 'Movie.1080p WEB-DL X264 AC3', 'media_id': 'Movie'}
upgrade_quality:
upgrade:
target: 1080p
Expand Down
10 changes: 5 additions & 5 deletions flexget/tests/test_yaml_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,20 @@ class TestYamlLists:
accept_all: yes
list_add:
- yaml_list:
fields:
- yaml_list:
fields:
- data
- quality
path: '{{yaml_dir}}/yaml_list1.yaml'
yaml_list_remove:
yaml_list_remove:
disable: seen
mock:
- {'title':'My Entry 1 1080p HDTV','url':'mock://myentry1'}
accept_all: yes
list_remove:
list_remove:
- yaml_list: '{{yaml_dir}}/yaml_list1.yaml'
yaml_list_match:
Expand All @@ -57,7 +57,7 @@ class TestYamlLists:
newfield: 'new'
list_add:
- yaml_list:
- yaml_list:
path: '{{yaml_dir}}/yaml_list1.yaml'
fields:
- newfield
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ line-length = 99
extend-exclude = ["flexget/ui"]

[tool.ruff.lint]
select = ["C4", "E", "F", "I", "ISC", "PGH", "PLE", "RUF", "SIM", "TCH", "UP"]
select = ["C4", "E", "F", "I", "ISC", "PGH", "PLE", "RUF", "SIM", "TCH", "UP", "W"]
ignore = [
"E501", # TODO: enable this rule (requires a lot of manual work)
"PLE1205", # Maybe can re-enable after https://github.com/astral-sh/ruff/issues/13390
Expand Down

0 comments on commit 2e96d9e

Please sign in to comment.