test_SalityBotnet.py 1.0 KB

12345678910111213141516171819202122232425262728293031
  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 = '8ff1e400dcf01d2d2cb97312cecdb71473ea140f6406ea935f74970aecdd7305'
  6. sha_botnet_most_used_ip_in_list = '8ff1e400dcf01d2d2cb97312cecdb71473ea140f6406ea935f74970aecdd7305'
  7. """
  8. CURRENT COVERAGE
  9. Name Stmts Miss Cover Missing (lines)
  10. ---------------------------------------------------------------------------
  11. Attack/SalityBotnet.py 77 0 100%
  12. """
  13. # TODO: get 100% coverage
  14. class UnitTestSalityBotnet(GenericTest):
  15. def test_botnet_basic(self):
  16. self.generic_test([['SalityBotnet']], sha_botnet_basic)
  17. @mock.patch('ID2TLib.Statistics.Statistics.get_most_used_ip_address')
  18. def test_botnet_most_used_ips(self, mock_most_used_ip_address):
  19. mock_most_used_ip_address.return_value = test_pcap_ips
  20. self.generic_test([['SalityBotnet']], sha_botnet_most_used_ip_in_list)
  21. if __name__ == '__main__':
  22. unittest.main()