test_SalityBotnet.py 1008 B

123456789101112131415161718192021222324252627282930
  1. import unittest
  2. import unittest.mock as mock
  3. from Test.GenericTest import GenericTest
  4. from Test.Lib import test_pcap_ips
  5. sha_botnet_basic = 'bbe75f917933a9f7727d99137920a70a5f720cabc773da9e24acfd6cba45a87a'
  6. sha_botnet_most_used_ip_in_list ='8583e2563d2756347449aec4b1c7cf7bfc7c0a96db4885627dcf0afc9e59feff'
  7. """
  8. CURRENT COVERAGE
  9. Name Stmts Miss Cover Missing (lines)
  10. ---------------------------------------------------------------------------
  11. Attack/SalityBotnet.py 77 0 100%
  12. """
  13. class UnitTestSalityBotnet(GenericTest):
  14. def test_botnet_basic(self):
  15. self.generic_test([['SalityBotnet']], sha_botnet_basic)
  16. @mock.patch('ID2TLib.Statistics.Statistics.get_most_used_ip_address')
  17. def test_botnet_most_used_ips(self, mock_most_used_ip_address):
  18. mock_most_used_ip_address.return_value = test_pcap_ips
  19. self.generic_test([['SalityBotnet']], sha_botnet_most_used_ip_in_list)
  20. if __name__ == '__main__':
  21. unittest.main()