コード例 #1
0
 def test_build_malicious_dbot_entry(self):
     from CommonServerPython import build_malicious_dbot_entry, outputPaths
     res = build_malicious_dbot_entry('8.8.8.8', 'ip', 'Vendor',
                                      'Google DNS')
     assert res == {
         outputPaths['ip']: {
             'Address': '8.8.8.8',
             'Malicious': {
                 'Vendor': 'Vendor',
                 'Description': 'Google DNS'
             }
         }
     }
コード例 #2
0
 def test_build_malicious_dbot_entry_file(self):
     from CommonServerPython import build_malicious_dbot_entry, outputPaths
     res = build_malicious_dbot_entry('md5hash', 'MD5', 'Vendor',
                                      'Google DNS')
     assert res == {
         outputPaths['file']: {
             "Malicious": {
                 "Vendor": "Vendor",
                 "Description": "Google DNS"
             },
             "MD5": "md5hash"
         }
     }
コード例 #3
0
 def test_build_malicious_dbot_entry_wrong_indicator_type(self):
     from CommonServerPython import build_malicious_dbot_entry, DemistoException
     with raises(DemistoException, match='Wrong indicator type'):
         build_malicious_dbot_entry('8.8.8.8', 'notindicator', 'Vendor',
                                    'Google DNS')