def test_get_cpu_process_with_error_status(self, mock_get_bulk_snmp):
     """
     :param:
     :return:
     """
     ip = "1.1.1.1"  # pylint:disable=invalid-name
     snmp_config_data = {"snmp_version": "v1", "snmp_community": "nhii"}
     snmp_iter = [(None, None, 1, [('1.1.1.1', 90), ('1.2.3.4', 80)]),
                  ('', "a", 1, [('1.1.1.1', 90), ('1.2.3.4', 80)])]
     mock_get_bulk_snmp.return_value = snmp_iter
     from statistics_collection.snmp.snmp_methods import get_cpu_process  # pylint:disable=import-error
     with self.assertRaises(Exception):
         get_cpu_process(ip, snmp_config_data)
 def test_get_cpu_process(self, mock_get_bulk_snmp):
     """
     :param:
     :return:
     """
     ip = "1.1.1.1"  # pylint:disable=invalid-name
     snmp_config_data = {"snmp_version": "v1", "snmp_community": "nhii"}
     snmp_iter = [(None, None, 1, [('1.1.1.1', 90), ('1.2.3.4', 80)]),
                  ('', "", 1, [('1.1.1.1', 90), ('1.2.3.4', 80)])]
     mock_get_bulk_snmp.return_value = snmp_iter
     from statistics_collection.snmp.snmp_methods import get_cpu_process  # pylint:disable=import-error
     actual = get_cpu_process(ip, snmp_config_data)
     expect = 85
     self.assertEqual(expect, actual)