30 lines
756 B
Python
30 lines
756 B
Python
|
from mkv_sub_fix import *
|
||
|
import unittest
|
||
|
|
||
|
|
||
|
class TestFileOpening(unittest.TestCase):
|
||
|
def testOpenExistingFile(self):
|
||
|
getListOfSubtitles("/home/lukas/Downloads/test5.mkv")
|
||
|
|
||
|
def testOpeningNonExistingFile(self):
|
||
|
with self.assertRaises(FileNotFoundError):
|
||
|
getListOfSubtitles("/nonexistent")
|
||
|
|
||
|
def testReturnListofSubtitles(self):
|
||
|
self.assertEqual(
|
||
|
getListOfSubtitles("/home/lukas/Downloads/test5.mkv"),
|
||
|
{
|
||
|
2: "eng",
|
||
|
3: "hun",
|
||
|
4: "ger",
|
||
|
5: "fre",
|
||
|
6: "spa",
|
||
|
7: "ita",
|
||
|
9: "jpn",
|
||
|
10: "und",
|
||
|
},
|
||
|
)
|
||
|
|
||
|
|
||
|
if __name__ == "__main__":
|
||
|
unittest.main()
|