File: test_force_series.py

package info (click to toggle)
tvnamer 3.0.4-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 392 kB
  • sloc: python: 3,778; makefile: 17
file content (49 lines) | stat: -rw-r--r-- 1,104 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env python

"""Test ability to set the series name by series id
"""

from functional_runner import run_tvnamer, verify_out_data
from helpers import attr


@attr("functional")
def test_series_id():
    """Test --series-id argument
    """

    conf = """
    {"always_rename": true,
    "select_first": true}
    """

    out_data = run_tvnamer(
        with_files = ['whatever.s01e01.avi'],
        with_config = conf,
        with_flags = ["--series-id", '76156'],
        with_input = "")

    expected_files = ['Scrubs - [01x01] - My First Day.avi']

    verify_out_data(out_data, expected_files)


@attr("functional")
def test_series_id_with_nameless_series():
    """Test --series-id argument with '6x17.etc.avi' type filename
    """

    conf = """
    {"always_rename": true,
    "select_first": true}
    """

    out_data = run_tvnamer(
        with_files = ['s01e01.avi'],
        with_config = conf,
        with_flags = ["--series-id", '76156'],
        with_input = "")

    expected_files = ['Scrubs - [01x01] - My First Day.avi']

    verify_out_data(out_data, expected_files)