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 = '72c537fba918154dbe937694d8da87260bebb05c0ad20802051fa80107c1efbe'
  5. sha_botnet_most_used_ip_in_list = '72c537fba918154dbe937694d8da87260bebb05c0ad20802051fa80107c1efbe'
  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)