Code Duplication    Length = 11-12 lines in 2 locations

tests/test_daemon.py 2 locations

@@ 661-672 (lines=12) @@
658
        for result in w.scan_collection.results_iterator('123-456', False):
659
            self.assertEqual(result.get('value'), '12345')
660
661
    def test_get_openvas_timestamp_scan_host_start(self, mock_nvti, mock_db):
662
        mock_db.get_host_scan_scan_end_time.return_value = None
663
        mock_db.get_host_scan_scan_end_time.return_value = '54321'
664
        w = DummyDaemon(mock_nvti, mock_db)
665
666
        target_list = w.create_xml_target()
667
        targets = w.process_targets_element(target_list)
668
669
        w.create_scan('123-456', targets, None, [])
670
        w.get_openvas_timestamp_scan_host('123-456', '192.168.0.1')
671
        for result in w.scan_collection.results_iterator('123-456', False):
672
            self.assertEqual(result.get('value'), '54321')
673
674
    def test_host_is_finished(self, mock_nvti, mock_db):
675
        mock_db.get_single_item.return_value = 'finished'
@@ 649-659 (lines=11) @@
646
        if hasattr(Mock, 'assert_called_once'):
647
            logging.Logger.warning.assert_called_once()
648
649
    def test_get_openvas_timestamp_scan_host_end(self, mock_nvti, mock_db):
650
        mock_db.get_host_scan_scan_end_time.return_value = '12345'
651
        w = DummyDaemon(mock_nvti, mock_db)
652
653
        target_list = w.create_xml_target()
654
        targets = w.process_targets_element(target_list)
655
656
        w.create_scan('123-456', targets, None, [])
657
        w.get_openvas_timestamp_scan_host('123-456', '192.168.0.1')
658
        for result in w.scan_collection.results_iterator('123-456', False):
659
            self.assertEqual(result.get('value'), '12345')
660
661
    def test_get_openvas_timestamp_scan_host_start(self, mock_nvti, mock_db):
662
        mock_db.get_host_scan_scan_end_time.return_value = None