Write test_initialize_webdriver

This commit is contained in:
The Magician 2023-10-19 12:11:51 +01:00
parent d39f859464
commit 3f00a144b4
1 changed files with 6 additions and 3 deletions

9
test_jardin.py Normal file → Executable file
View File

@ -1,13 +1,16 @@
#!/usr/bin/python3
import unittest import unittest
from unittest import mock from unittest.mock import patch
import jardin import jardin
class TestJardin(unittest.TestCase): class TestJardin(unittest.TestCase):
@mock.patch("webdriver.Firefox") @patch("selenium.webdriver.Firefox")
def test_initialize_webdriver(self, mockFirefox): def test_initialize_webdriver(self, mockFirefox):
jardin.initialize_webdriver() jardin.initialize_webdriver()
mockFirefox.assert_called_once() mockFirefox.assert_called_once()
if __name__ == "__main__":
unittest.main()