-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v1.0.6
- Loading branch information
Showing
11 changed files
with
1,023 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Pending things | ||
-------------- | ||
|
||
* Fix tests | ||
* Add information about seeds/leeches on each torrent | ||
* Add more search engines | ||
* Maybe direct search to the DHT? | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
"""Tets dibgit plugin.""" | ||
|
||
|
||
def test_digbit_search_magnets(): | ||
"""Test digbit search magnets method.""" | ||
from katcr import DigBt | ||
from robobrowser import RoboBrowser | ||
from unittest.mock import patch, MagicMock | ||
|
||
with patch('katcr.torrentmirror.get_proxies', | ||
side_effect=({},)) as mock: | ||
with patch('katcr.robobrowser.RoboBrowser', spec=RoboBrowser) as mock: | ||
DigBt(MagicMock()).search_magnets('foo', 1) | ||
assert mock.open.called_once_with('foo') | ||
|
||
|
||
def test_digbit_tabulate(): | ||
"""Test tabulate method given a known structure. | ||
Note that this structure may change in the future or even between | ||
different proxied sites... This needs to be handled somehow. | ||
""" | ||
from katcr import DigBt | ||
import bs4 | ||
to_parse = """<tr><div class=head><a>Foo</a></div> | ||
<div class=tail>1 2 3 4 Bar<a href='foo'> | ||
</a></div></tr>""" | ||
fakelink = bs4.BeautifulSoup(to_parse, "html.parser") | ||
result = DigBt.tabulate(fakelink.find('tr')) | ||
assert result == ('Foo', 'Bar', 'foo') |
Oops, something went wrong.