From 3cd4f9111f4a050ff365bbe103993b3a89fdc29d Mon Sep 17 00:00:00 2001 From: jvoisin Date: Sun, 8 Jul 2018 15:13:03 +0200 Subject: Bump coverage for torrent handling --- tests/test_corrupted_files.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'tests/test_corrupted_files.py') 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): with self.assertRaises(ValueError): torrent.TorrentParser('./tests/data/clean.torrent') + with open("./tests/data/clean.torrent", "w") as f: + f.write("i-0e") + with self.assertRaises(ValueError): + torrent.TorrentParser('./tests/data/clean.torrent') + + with open("./tests/data/clean.torrent", "w") as f: + f.write("i00e") + with self.assertRaises(ValueError): + torrent.TorrentParser('./tests/data/clean.torrent') + + with open("./tests/data/clean.torrent", "w") as f: + f.write("d01:AAAAAAAAA") + with self.assertRaises(ValueError): + torrent.TorrentParser('./tests/data/clean.torrent') + + with open("./tests/data/clean.torrent", "w") as f: + f.write("1:aaa") + with self.assertRaises(ValueError): + torrent.TorrentParser('./tests/data/clean.torrent') + os.remove('./tests/data/clean.torrent') def test_odg(self): -- cgit v1.3