@@ -0,0 +1,2509 @@
+# -*- coding: utf-8 -*-%0A%0Aimport unittest%0Aimport os%0A%0Aimport intelmq.lib.utils as utils%0Aimport intelmq.lib.test as test%0Afrom intelmq.bots.parsers.generic.parser_csv import GenericCsvParserBot%0A%0Awith open(os.path.join(os.path.dirname(__file__), 'empty_src_url.csv')) as handle:%0A    SAMPLE_FILE = handle.read()%0ASAMPLE_SPLIT = SAMPLE_FILE.splitlines()%0A%0AEXAMPLE_REPORT = %7B%22feed.name%22: %22Sample CSV Feed%22,%0A                  %22raw%22: utils.base64_encode(SAMPLE_FILE),%0A                  %22__type%22: %22Report%22,%0A                  %22time.observation%22: %222015-01-01T00:00:00+00:00%22,%0A                  %7D%0AEXAMPLE_EVENT = %7B%22feed.name%22: %22Sample CSV Feed%22,%0A                 %22__type%22: %22Event%22,%0A                 %22raw%22: utils.base64_encode(SAMPLE_SPLIT%5B1%5D.replace('%22', '')+'%5Cr%5Cn'),%0A                 %22time.observation%22: %222015-01-01T00:00:00+00:00%22,%0A                 %22classification.type%22: %22botnet drone%22,%0A                 %22source.ip%22: %2211.11.11.11%22,%0A                 %22feed.name%22: %22Sample CSV Feed%22,%0A                 %22source.port%22: 9001,%0A                 %22source.url%22: %22http://test.com%22%0A                 %7D%0A%0AEXAMPLE_EVENT2 = %7B%22feed.name%22: %22Sample CSV Feed%22,%0A                 %22__type%22: %22Event%22,%0A                 %22raw%22: utils.base64_encode(SAMPLE_SPLIT%5B2%5D.replace('%22', '')+'%5Cr%5Cn'),%0A                 %22time.observation%22: %222015-01-01T00:00:00+00:00%22,%0A                 %22classification.type%22: %22botnet drone%22,%0A                 %22source.ip%22: %2211.11.11.11%22,%0A                 %22feed.name%22: %22Sample CSV Feed%22,%0A                 %22source.port%22: 9001%0A                 %7D%0A%0Aclass TestGenericCsvParserBot(test.BotTestCase, unittest.TestCase):%0A    %22%22%22%0A    A TestCase for a GenericCsvParserBot with extra, column_regex_search and windows_nt time format.%0A    %22%22%22%0A%0A    @classmethod%0A    def set_bot(cls):%0A        cls.bot_reference = GenericCsvParserBot%0A        cls.default_input_message = EXAMPLE_REPORT%0A#source_ip,source_url,source_port%0A        cls.sysconfig = %7B%22columns%22: %5B %22source.ip%22, %22source.url%22, %22source.port%22 %5D,%0A                         %22delimiter%22: %22,%22,%0A                         %22skip_header%22: True,%0A                         %22type%22: %22botnet drone%22,%0A                         %22default_url_protocol%22: %22http://%22,%0A                         %22type_translation%22: None%7D%0A%0A    def test_event(self):%0A        %22%22%22 Test if correct Event has been produced. %22%22%22%0A        self.run_bot()%0A        self.run_bot()%0A        self.assertMessageEqual(0, EXAMPLE_EVENT)%0A        self.assertMessageEqual(1, EXAMPLE_EVENT2)%0A%0A%0Aif __name__ == '__main__':  # pragma: no cover%0A    unittest.main()%0A

add test case for default_url_protocol fix