wifipumpkin3/tests/test_exceptions.py

20 lines
729 B
Python
Raw Normal View History

2020-04-09 15:24:44 +00:00
import unittest
from wifipumpkin3.exceptions.errors.dhcpException import DHCPServerSettingsError
from wifipumpkin3.core.common.platforms import Linux
class TestException(unittest.TestCase):
def test_dhcp_error_message(self):
with self.assertRaises(DHCPServerSettingsError):
raise DHCPServerSettingsError('', '')
def test_read_file_exception(self):
self.result_content = 'dhcp test massage'
self.get_file_content = Linux.readFileExceptions('dhcp_test_message')
self.assertEqual(self.result_content, self.get_file_content)
# def test_raise(self):
# raise DHCPServerSettingsError('DHCP Server', 'range ip error')
if __name__ == '__main__':
unittest.main()