Skip to content
Snippets Groups Projects
Commit 0e5b618e authored by Daniel Yang's avatar Daniel Yang
Browse files

Added ip spoofing test case

parent 03220dfd
No related branches found
No related tags found
No related merge requests found
......@@ -17,6 +17,12 @@ class TestPacketCapturing(unittest.TestCase):
packet_handler(packet)
mock_print.assert_called_with("Packet captured: 100.84.6.141 -> 192.168.1.1")
def test_ip_spoofing(self):
packet = IP(src = "169.254.6.141", dst = "192.168.1.1")
with patch('builtins.print') as mock_print:
packet_handler(packet)
mock_print.assert_called_with("Possible IP spoofing using private networks detected.")
if __name__ == '__main__':
unittest.main()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment