summaryrefslogtreecommitdiff
path: root/tests/test_corrupted_files.py
diff options
context:
space:
mode:
authorjvoisin2018-07-08 15:13:03 +0200
committerjvoisin2018-07-08 15:13:03 +0200
commit3cd4f9111f4a050ff365bbe103993b3a89fdc29d (patch)
tree89d2cb1d9e5ba5838d517e728bcfe82f682e871a /tests/test_corrupted_files.py
parentb5fcddd6a68b7e18d1e5521e7363046ca0e68667 (diff)
Bump coverage for torrent handling
Diffstat (limited to '')
-rw-r--r--tests/test_corrupted_files.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/test_corrupted_files.py b/tests/test_corrupted_files.py
index 776b0e9..a77acbc 100644
--- a/tests/test_corrupted_files.py
+++ b/tests/test_corrupted_files.py
@@ -54,6 +54,26 @@ class TestCorruptedFiles(unittest.TestCase):
54 with self.assertRaises(ValueError): 54 with self.assertRaises(ValueError):
55 torrent.TorrentParser('./tests/data/clean.torrent') 55 torrent.TorrentParser('./tests/data/clean.torrent')
56 56
57 with open("./tests/data/clean.torrent", "w") as f:
58 f.write("i-0e")
59 with self.assertRaises(ValueError):
60 torrent.TorrentParser('./tests/data/clean.torrent')
61
62 with open("./tests/data/clean.torrent", "w") as f:
63 f.write("i00e")
64 with self.assertRaises(ValueError):
65 torrent.TorrentParser('./tests/data/clean.torrent')
66
67 with open("./tests/data/clean.torrent", "w") as f:
68 f.write("d01:AAAAAAAAA")
69 with self.assertRaises(ValueError):
70 torrent.TorrentParser('./tests/data/clean.torrent')
71
72 with open("./tests/data/clean.torrent", "w") as f:
73 f.write("1:aaa")
74 with self.assertRaises(ValueError):
75 torrent.TorrentParser('./tests/data/clean.torrent')
76
57 os.remove('./tests/data/clean.torrent') 77 os.remove('./tests/data/clean.torrent')
58 78
59 def test_odg(self): 79 def test_odg(self):