test_SalityBotnet.py 729 B

123456789101112131415161718
  1. import unittest.mock as mock
  2. import Test.ID2TAttackTest as Test
  3. import ID2TLib.TestLibrary as Lib
  4. sha_botnet_basic = '8ff1e400dcf01d2d2cb97312cecdb71473ea140f6406ea935f74970aecdd7305'
  5. sha_botnet_most_used_ip_in_list = '8ff1e400dcf01d2d2cb97312cecdb71473ea140f6406ea935f74970aecdd7305'
  6. class UnitTestSalityBotnet(Test.ID2TAttackTest):
  7. def test_botnet_basic(self):
  8. self.checksum_test([['SalityBotnet']], sha_botnet_basic)
  9. @mock.patch('ID2TLib.Statistics.Statistics.get_most_used_ip_address')
  10. def test_botnet_most_used_ip(self, mock_most_used_ip_address):
  11. mock_most_used_ip_address.return_value = Lib.test_pcap_ips[0]
  12. self.checksum_test([['SalityBotnet']], sha_botnet_most_used_ip_in_list)