Skip to content

Commit

Permalink
Add test cases for seeder and leecher
Browse files Browse the repository at this point in the history
  • Loading branch information
jerrymakesjelly committed Feb 7, 2020
1 parent c5e031a commit 18cb635
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 0 deletions.
4 changes: 4 additions & 0 deletions autoremovetorrents/strategy.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
from .condition.seedingtime import SeedingTimeCondition
from .condition.createtime import CreateTimeCondition
from .condition.ratio import RatioCondition
from .condition.seeder import SeederCondition
from .condition.leecher import LeecherCondition
from .condition.downloadspeed import DownloadSpeedCondition
from .condition.uploadspeed import UploadSpeedCondition
from .condition.torrentsize import TorrentSizeCondition
Expand Down Expand Up @@ -70,6 +72,8 @@ def _apply_conditions(self):
'seeding_time': SeedingTimeCondition,
'create_time': CreateTimeCondition,
'ratio': RatioCondition,
'max_seeder': SeederCondition,
'min_leecher': LeecherCondition,
'max_downloadspeed': DownloadSpeedCondition,
'min_uploadspeed': UploadSpeedCondition,
'size': SizeCondition,
Expand Down
12 changes: 12 additions & 0 deletions pytest/test_strategies/cases/max_seeder/test_max_seeder.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
test:
max_seeder: 10
remove:
- Torrent - 3
- Torrent - 5
- Torrent - 6
- Torrent - 7
- Torrent - 8
- Torrent - 10
- Torrent - 13
- Torrent - 14
- Torrent - 16
10 changes: 10 additions & 0 deletions pytest/test_strategies/cases/min_leecher/test_min_leecher.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
test:
min_leecher: 10
remove:
- Torrent - 4
- Torrent - 5
- Torrent - 7
- Torrent - 8
- Torrent - 9
- Torrent - 13
- Torrent - 14
2 changes: 2 additions & 0 deletions pytest/test_strategies/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ def test_data():
torrent_obj.upload_speed = torrent['upspeed']
torrent_obj.download_speed = torrent['dlspeed']
torrent_obj.last_activity = torrent['last_activity']
torrent_obj.seeder = torrent['num_complete']
torrent_obj.leecher = torrent['num_incomplete']
input_torrents.append(torrent_obj)

return input_torrents
Expand Down

0 comments on commit 18cb635

Please sign in to comment.