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