Skip to content

Commit a22a8c1

Browse files
authored
Merge pull request #114 from alexpdev/v0.7.2
bump version v0.7.2
2 parents ac7f3a4 + 38fc97b commit a22a8c1

File tree

17 files changed

+871
-634
lines changed

17 files changed

+871
-634
lines changed

docs/objects.inv

11 Bytes
Binary file not shown.

docs/search/search_index.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

docs/sitemap.xml.gz

0 Bytes
Binary file not shown.

docs/source/index.html

Lines changed: 722 additions & 550 deletions
Large diffs are not rendered by default.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "torrentfile",
33
"displayName": "TorrentFile",
4-
"version": "0.7.1",
4+
"version": "0.7.2",
55
"description": "Create Bittorent v1, v2 and hybrid meta files.",
66
"repository": {
77
"type": "git",

tests/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ def metafile1(dir1, request):
202202
"path": dir1,
203203
"announce": ["url1", "url2", "url4"],
204204
"url_list": ["url5", "url6", "url7"],
205+
"httpseeds": ["url5", "url6", "url7"],
205206
"comment": "this is a comment",
206207
"source": "SomeSource",
207208
"private": 1,
@@ -224,6 +225,7 @@ def metafile2(dir2, request):
224225
"announce": ["url1", "url4"],
225226
"url_list": ["url6", "url7"],
226227
"comment": "this is a comment",
228+
"httpseeds": ["url6", "url7"],
227229
"source": "SomeSource",
228230
"private": 1,
229231
}
@@ -254,6 +256,7 @@ def filemeta1(file1, request):
254256
"path": file1,
255257
"announce": ["url1", "url4"],
256258
"url_list": ["url6", "url7"],
259+
"httpseeds": ["url6", "url7"],
257260
"comment": "this is a comment",
258261
"source": "SomeSource",
259262
"private": 1,
@@ -276,6 +279,7 @@ def filemeta2(file2, request):
276279
"path": file2,
277280
"announce": ["url1", "url4"],
278281
"url_list": ["url6", "url7"],
282+
"httpseeds": ["url7", "url8"],
279283
"comment": "this is a comment",
280284
"source": "SomeSource",
281285
"private": 1,
@@ -306,7 +310,7 @@ def sizedfiles(dir2, sizes, request):
306310
"""
307311
versions = torrents()
308312
args = {
309-
"path": dir2,
313+
"content": dir2,
310314
"announce": ["url1", "url2", "url4"],
311315
"url_list": ["url5", "url6", "url7"],
312316
"comment": "this is a comment",

tests/test_cli.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,9 @@ def test_cli_slash_path(dir1, ending):
434434
rmpath(outfile)
435435

436436

437-
@pytest.mark.parametrize("flag", ["-t", "-w", "--announce", "--web-seed"])
437+
@pytest.mark.parametrize(
438+
"flag", ["-t", "-w", "--announce", "--web-seed", "--http-seed"]
439+
)
438440
def test_cli_announce_path(dir1, flag):
439441
"""
440442
Test CLI when path is placed after the trackers flag.

tests/test_commands.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,12 @@ def test_info(field, file1):
104104
"url1",
105105
"url2",
106106
"url3",
107+
"--web-seed",
108+
"url4",
109+
"url5",
110+
"--http-seed",
111+
"url6",
112+
"url7",
107113
"--private",
108114
"--comment",
109115
"ExampleComment",

tests/test_edit.py

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,18 @@ def test_edit_urllist_str(metafile2, url_list):
7575
assert data["url-list"] == url_list.split()
7676

7777

78+
@pytest.mark.parametrize("httpseeds", ["urla", "urlb urlc", "urla urlb urlc"])
79+
def test_edit_httpseeds_str(metafile2, httpseeds):
80+
"""
81+
Test edit torrent with webseed param.
82+
"""
83+
edits = {"httpseeds": httpseeds}
84+
data = edit_torrent(metafile2, edits)
85+
meta = pyben.load(metafile2)
86+
assert data == meta
87+
assert data["httpseeds"] == httpseeds.split()
88+
89+
7890
@pytest.mark.parametrize(
7991
"url_list", [["urla"], ["urlb", "urlc"], ["urla", "urlb", "urlc"]]
8092
)
@@ -89,6 +101,20 @@ def test_edit_urllist(metafile2, url_list):
89101
assert data["url-list"] == url_list
90102

91103

104+
@pytest.mark.parametrize(
105+
"httpseed", [["urla"], ["urlb", "urlc"], ["urla", "urlb", "urlc"]]
106+
)
107+
def test_edit_httpseeds(metafile2, httpseed):
108+
"""
109+
Test edit torrent with webseed param as string.
110+
"""
111+
edits = {"httpseeds": httpseed}
112+
data = edit_torrent(metafile2, edits)
113+
meta = pyben.load(metafile2)
114+
assert data == meta
115+
assert data["httpseeds"] == httpseed
116+
117+
92118
@pytest.mark.parametrize("comment", ["COMMENT", "COMIT", "MITCO"])
93119
def test_edit_comment(metafile2, comment):
94120
"""
@@ -159,6 +185,7 @@ def test_edit_removal(metafile2):
159185
edits = {
160186
"announce": "",
161187
"url-list": "",
188+
"httpseeds": "",
162189
"comment": "",
163190
"source": "",
164191
"private": "",
@@ -172,7 +199,8 @@ def test_edit_removal(metafile2):
172199
@pytest.mark.parametrize("source", ["sourcea", "sourceb", "sourcec"])
173200
@pytest.mark.parametrize("announce", [["url1", "url2", "url3"], ["url1"]])
174201
@pytest.mark.parametrize("webseed", [["ftp1"], ["ftpa", "ftpb"]])
175-
def test_edit_cli(metafile2, comment, source, announce, webseed):
202+
@pytest.mark.parametrize("httpseed", [["ftp1"], ["ftpa", "ftpb"]])
203+
def test_edit_cli(metafile2, comment, source, announce, webseed, httpseed):
176204
"""
177205
Test edit torrent with all params on cli.
178206
"""
@@ -186,6 +214,8 @@ def test_edit_cli(metafile2, comment, source, announce, webseed):
186214
source,
187215
"--web-seed",
188216
webseed,
217+
"--http-seed",
218+
httpseed,
189219
"--tracker",
190220
announce,
191221
"--private",

tests/test_interactive.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ def test_interactive_create(monkeypatch, file1):
5353
"",
5454
"",
5555
"",
56+
"",
5657
file1,
5758
str(file1) + ".torrent",
5859
"",
@@ -87,6 +88,7 @@ def test_inter_create_full(
8788
piece_length,
8889
announce,
8990
url_list,
91+
url_list,
9092
comment,
9193
source,
9294
"Y",
@@ -125,6 +127,7 @@ def test_inter_edit_full(
125127
source,
126128
"5",
127129
url_list,
130+
"",
128131
"6",
129132
"Y",
130133
"DONE",
@@ -158,6 +161,7 @@ def test_inter_edit_cli(filemeta2, announce, cmnt, srce, urllist, monkeypatch):
158161
srce,
159162
"5",
160163
urllist,
164+
urllist,
161165
"6",
162166
"Y",
163167
"DONE",

0 commit comments

Comments
 (0)