<commit_before># -*- coding: utf-8 -*-

import os
import unittest

import intelmq.lib.test as test
import intelmq.lib.utils as utils
from intelmq.bots.parsers.bambenek.parser_c2ipmasterlist import Bambenekc2ipmasterlistParserBot

with open(os.path.join(os.path.dirname(__file__), 'c2-ipmasterlist.txt')) as handle:
    EXAMPLE_FILE = handle.read()

EXAMPLE_REPORT = {"feed.name": "Bambenek C2 IP Feed",
                  "feed.url": "http://osint.bambenekconsulting.com/feeds/c2-ipmasterlist.txt",
                  "raw": utils.base64_encode(EXAMPLE_FILE),
                  "__type": "Report",
                  "time.observation": "2016-01-01T00:00:00+00:00",
                 }
EVENTS = [{"feed.name": "Bambenek C2 IP Feed",
           "feed.url": "http://osint.bambenekconsulting.com/feeds/c2-ipmasterlist.txt",
           "__type": "Event",
           "time.source": "2016-11-12T18:02:00+00:00",
           "destination.ip": "172.16.17.32",
           "classification.type": "c&c",
           "time.observation": "2016-01-01T00:00:00+00:00",
           "event_description.text": "IP used by shiotob/urlzone/bebloh C&C",
           "event_description.url": "http://osint.bambenekconsulting.com/manual/bebloh.txt",
           "raw": "<KEY>",
          }]

class TestBambenekc2ipmasterlistParserBot(test.BotTestCase, unittest.TestCase):
    """
    A TestCase for Bambenekc2ipmasterlistParserBot
    """

    @classmethod
    def set_bot(cls):
        cls.bot_reference = Bambenekc2ipmasterlistParserBot
        cls.default_input_message = EXAMPLE_REPORT

    def test_event(self):<commit_msg>Added Bambenek corrected test files<commit_after># -*- coding: utf-8 -*-

import os
import unittest

import intelmq.lib.test as test
import intelmq.lib.utils as utils
from intelmq.bots.parsers.bambenek.parser_c2ipmasterlist import Bambenekc2ipmasterlistParserBot

with open(os.path.join(os.path.dirname(__file__), 'c2-ipmasterlist.txt')) as handle:
    EXAMPLE_FILE = handle.read()

EXAMPLE_REPORT = {"feed.name": "Bambenek C2 IP Feed",
                  "feed.url": "http://osint.bambenekconsulting.com/feeds/c2-ipmasterlist.txt",
                  "raw": utils.base64_encode(EXAMPLE_FILE),
                  "__type": "Report",
                  "time.observation": "2016-01-01T00:00:00+00:00",
                 }
EVENTS = [{"feed.name": "Bambenek C2 IP Feed",
           "feed.url": "http://osint.bambenekconsulting.com/feeds/c2-ipmasterlist.txt",
           "__type": "Event",
           "time.source": "2016-11-12T18:02:00+00:00",
           "destination.ip": "172.16.17.32",
           "classification.type": "c&c",
           "status": "online",
           "time.observation": "2016-01-01T00:00:00+00:00",
           "event_description.text": "IP used by shiotob/urlzone/bebloh C&C",
           "event_description.url": "http://osint.bambenekconsulting.com/manual/bebloh.txt",
           "raw": "<KEY>",
          }]

class TestBambenekc2ipmasterlistParserBot(test.BotTestCase, unittest.TestCase):
    """
    A TestCase for Bambenekc2ipmasterlistParserBot
    """

    @classmethod
    def set_bot(cls):
        cls.bot_reference = Bambenekc2ipmasterlistParserBot
        cls.default_input_message = EXAMPLE_REPORT

    def test_event(self):
{'fraction_non_alphanumeric': 0.1411402157164869, 'fraction_numerical': 0.04684129429892142, 'mean_word_length': 2.845971563981043, 'pattern_counts': {'":': 31, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5831456', 'n_tokens_mistral': 1222, 'n_tokens_neox': 1127, 'n_words': 173}