added 2nd test

This commit is contained in:
Agata 2020-12-21 23:45:46 +01:00
parent 467f8e5578
commit 21b49e425d

View File

@ -1,5 +1,7 @@
import unittest
from main import *
from unittest.mock import Mock
from pathlib import Path
# test saving file
class savingFileTest(unittest.TestCase):
@ -22,5 +24,17 @@ class savingFileTest(unittest.TestCase):
self.assertEqual(old_file_content, new_file_content)
# test using mock checking if a file with analysis had been generated
class generetingOutputFile(unittest.TestCase):
def test_output_file(self):
print('Moock testing outputfile')
m = Mock()
m.output_file_path = scriptPath + '\\files\\output\\test.pdf'
assert Path(m.output_file_path).is_file()
if __name__ == '__main__':
unittest.main()