forked from Flexget/Flexget
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_from_task.py
33 lines (31 loc) · 1.18 KB
/
test_from_task.py
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
class TestFromTask(object):
config = """
tasks:
subtask:
mock:
- title: subtask entry 1
other_field: 5
- title: subtask entry 1
accept_all: yes
main_task:
from_task: subtask
manual_subtask:
manual: yes
mock:
- title: manual entry 1
accept_all: yes
test_manual_subtask:
from_task: manual_subtask
"""
def test_from_task(self, execute_task):
task = execute_task('main_task')
assert len(task.entries) == 2, 'Should have produced both subtask entries'
assert len(task.accepted) == 0, 'Accepted status should not pass through from subtask'
assert (
task.find_entry(title='subtask entry 1')['other_field'] == 5
), 'other fields should pass through'
task = execute_task('main_task')
assert len(task.entries) == 2, "seen plugin shouldn't reject subtask entries"
def test_manual_subtask(self, execute_task):
task = execute_task('test_manual_subtask')
assert len(task.entries) == 1, 'Should have run subtask even when marked as manual'