Ejemplo n.º 1
0
    def test_processing(self):
        """Test that all targets are processed"""

        s1 = 'gigi'
        t1 = ['becali']

        # Test servers with a list of metrics
        targets = {s1: t1}

        writer = CSVWriterMock()
        detector = ErrorDetectorMock()

        process_targets(targets, 0, writer, detector)

        # Test that nothing was processed
        self.assertEqual(len(writer.lines), 0)
    def test_processing(self):
        """Test that all targets are processed"""

        s1 = 'gigi'
        t1 = ['becali']

        # Test servers with a list of metrics
        targets = {s1: t1}

        writer = CSVWriterMock()
        detector = ErrorDetectorMock()

        process_targets(targets, 0, writer, detector)

        # Test that nothing was processed
        self.assertEqual(len(writer.lines), 0)
Ejemplo n.º 3
0
    def test_processing(self):
        """Test that all targets are processed"""

        s1 = 'gigi'
        s2 = 'marean'

        t1 = ['becali', 'meme']
        t2 = ['vanghelie']

        expected_results = 2 * (len(t1) + len(t2))

        # Test servers with a list of metrics
        targets = {s1: t1, s2: t2}

        writer = CSVWriterMock()
        detector = DetectorMock()

        process_targets(targets, 0, writer, detector)

        lines = writer.lines
        # Test all metrics produced two spikes
        self.assertEqual(len(lines), expected_results,
                         "Not all targets were processed")
    def test_processing(self):
        """Test that all targets are processed"""

        s1 = 'gigi'
        s2 = 'marean'

        t1 = ['becali', 'meme']
        t2 = ['vanghelie']

        expected_results = 2 * (len(t1) + len(t2))

        # Test servers with a list of metrics
        targets = {s1: t1, s2: t2}

        writer = CSVWriterMock()
        detector = DetectorMock()

        process_targets(targets, 0, writer, detector)

        lines = writer.lines
        # Test all metrics produced two spikes
        self.assertEqual(len(lines), expected_results,
                         "Not all targets were processed")