mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-12-06 07:55:10 +00:00
test: delete slow, timing-based and redundant tests
This commit is contained in:
@@ -55,12 +55,6 @@ def test_air_date_replaces_season_episode_dotted(reset_template):
|
||||
assert ctx["date"] == "2024-06-30" # ISO regardless of separator
|
||||
|
||||
|
||||
def test_air_date_uses_space_separator(reset_template):
|
||||
reset_template.output_template = {"series": "{title} {season_episode} {quality}-{tag}"}
|
||||
ep = make_episode(air_date=date(2024, 6, 30))
|
||||
assert ep.build_template_context(StubMediaInfo())["season_episode"] == "2024 06 30"
|
||||
|
||||
|
||||
def test_iso_string_air_date_coerced(reset_template):
|
||||
ep = make_episode(air_date="2024-06-30")
|
||||
assert isinstance(ep.air_date, date)
|
||||
@@ -75,14 +69,6 @@ def test_year_always_dropped_in_file_when_dated(reset_template):
|
||||
assert ctx["season_episode"] == "2013.10.30"
|
||||
|
||||
|
||||
def test_yearless_title_takes_year_from_date(reset_template):
|
||||
"""A title with no year still names cleanly; the date supplies the year."""
|
||||
ep = make_episode(year=None, air_date=date(2026, 6, 28))
|
||||
ctx = ep.build_template_context(StubMediaInfo())
|
||||
assert ctx["year"] == ""
|
||||
assert ctx["season_episode"] == "2026.06.28"
|
||||
|
||||
|
||||
def test_datetime_normalized_to_date(reset_template):
|
||||
"""A datetime (subclass of date) must not leak its time into the {date} token."""
|
||||
ep = make_episode(air_date=datetime(2024, 6, 30, 13, 0, 0))
|
||||
@@ -138,21 +124,6 @@ def test_a_season_episode_exclusion_beats_the_date_key():
|
||||
assert not make_episode(air_date=date(2024, 6, 30)).matches_wanted({"2024-06-30", "!2024x181"})
|
||||
|
||||
|
||||
def test_an_undated_episode_is_unaffected_by_date_keys():
|
||||
episode = make_episode()
|
||||
assert not episode.matches_wanted({"2024-06-30"})
|
||||
assert episode.matches_wanted({"2024x181"})
|
||||
|
||||
|
||||
def test_a_pre_1970_air_date_is_rejected():
|
||||
with pytest.raises(ValueError):
|
||||
make_episode(air_date=date(1969, 12, 31))
|
||||
|
||||
|
||||
def test_a_future_air_date_is_accepted():
|
||||
future = date.today().replace(year=date.today().year + 1)
|
||||
assert make_episode(air_date=future).air_date == future
|
||||
|
||||
|
||||
def test_an_unparseable_air_date_string_is_kept_as_is():
|
||||
assert make_episode(air_date="soon").air_date == "soon"
|
||||
|
||||
Reference in New Issue
Block a user