Initial commit.
This commit is contained in:
0
tests/__init__.py
Normal file
0
tests/__init__.py
Normal file
0
tests/unit/__init__.py
Normal file
0
tests/unit/__init__.py
Normal file
30
tests/unit/test_open_existing_file.py
Normal file
30
tests/unit/test_open_existing_file.py
Normal file
@ -0,0 +1,30 @@
|
||||
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()
|
Reference in New Issue
Block a user