예제 #1
0
 def test_mozdefhostname_mock_exception(self, mock_path):
     mock_path.side_effect = ValueError
     event = {
         'category': 'proxy',
         'SOURCE': 'something',
         'customendpoint': ' '
     }
     plugin = message()
     result, metadata = plugin.onMessage(event, self.metadata)
     assert result['mozdefhostname'] == 'failed to fetch mozdefhostname'
예제 #2
0
 def test_mozdefhostname_mock_string(self, mock_path):
     mock_path.return_value = 'samplehostname'
     event = {
         'category': 'proxy',
         'SOURCE': 'something',
         'customendpoint': ' '
     }
     plugin = message()
     result, metadata = plugin.onMessage(event, self.metadata)
     assert result['mozdefhostname'] == 'samplehostname'
예제 #3
0
 def setup(self):
     self.plugin = message()
     self.metadata = {
         'index': 'events'
     }
예제 #4
0
 def setup(self):
     self.plugin = message()
     self.metadata = {'doc_type': 'nsm', 'index': 'events'}
예제 #5
0
 def setup(self):
     self.plugin = message()
     self.metadata = {
         'doc_type': 'nsm',
         'index': 'events'
     }