summaryrefslogtreecommitdiff
path: root/tests/test_corrupted_files.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_corrupted_files.py')
-rw-r--r--tests/test_corrupted_files.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/tests/test_corrupted_files.py b/tests/test_corrupted_files.py
index bc5b9d0..776b0e9 100644
--- a/tests/test_corrupted_files.py
+++ b/tests/test_corrupted_files.py
@@ -46,15 +46,14 @@ class TestCorruptedFiles(unittest.TestCase):
46 46
47 def test_torrent(self): 47 def test_torrent(self):
48 shutil.copy('./tests/data/dirty.png', './tests/data/clean.torrent') 48 shutil.copy('./tests/data/dirty.png', './tests/data/clean.torrent')
49 p = torrent.TorrentParser('./tests/data/clean.torrent') 49 with self.assertRaises(ValueError):
50 self.assertFalse(p.remove_all()) 50 torrent.TorrentParser('./tests/data/clean.torrent')
51 expected = {'Unknown meta': 'Unable to parse torrent file "./tests/data/clean.torrent".'}
52 self.assertEqual(p.get_meta(), expected)
53 51
54 with open("./tests/data/clean.torrent", "a") as f: 52 with open("./tests/data/clean.torrent", "a") as f:
55 f.write("trailing garbage") 53 f.write("trailing garbage")
56 p = torrent.TorrentParser('./tests/data/clean.torrent') 54 with self.assertRaises(ValueError):
57 self.assertEqual(p.get_meta(), expected) 55 torrent.TorrentParser('./tests/data/clean.torrent')
56
58 os.remove('./tests/data/clean.torrent') 57 os.remove('./tests/data/clean.torrent')
59 58
60 def test_odg(self): 59 def test_odg(self):