aboutsummaryrefslogtreecommitdiffstats
path: root/app/test/event_based_scan/test_event.py
blob: 745fc2bcba0159f1e1856923694ecfaa724edc29 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
###############################################################################
# Copyright (c) 2017 Koren Lev (Cisco Systems), Yaron Yogev (Cisco Systems)   #
# and others                                                                  #
#                                                                             #
# All rights reserved. This program and the accompanying materials            #
# are made available under the terms of the Apache License, Version 2.0       #
# which accompanies this distribution, and is available at                    #
# http://www.apache.org/licenses/LICENSE-2.0                                  #
###############################################################################
import unittest
from unittest.mock import patch, Mock

from test.event_based_scan.test_data.test_config \
    import ENV_CONFIG, COLLECTION_CONFIG
from utils.logging.console_logger import ConsoleLogger


class TestEvent(unittest.TestCase):
    def setUp(self):
        self.log = ConsoleLogger()
        self.env = ENV_CONFIG
        self.collection = COLLECTION_CONFIG
        self.item_ids = []

        self.inv_patcher = patch('discover.events.event_base.InventoryMgr')
        self.inv_class = self.inv_patcher.start()
        self.inv = self.inv_class.return_value

        self.log_patcher = patch('discover.fetcher.FullLogger')
        self.log_patcher.start()

    def tearDown(self):
        self.inv_patcher.stop()
        self.log_patcher.stop()