Code Duplication    Length = 22-22 lines in 2 locations

tests/test_scan_and_result.py 2 locations

@@ 269-290 (lines=22) @@
266
            ET.tostring(modification_time[0]).decode('utf-8'),
267
        )
268
269
    def test_get_vts_filter_negative(self):
270
        daemon = DummyWrapper([])
271
        daemon.add_vt(
272
            '1.2.3.4',
273
            'A vulnerability test',
274
            vt_params="a",
275
            vt_modification_time='19000202',
276
        )
277
        response = secET.fromstring(
278
            daemon.handle_command(
279
                '<get_vts filter="modification_time&lt;19000203"></get_vts>'
280
            )
281
        )
282
        self.assertEqual(response.get('status'), '200')
283
        vts = response.find('vts')
284
        self.assertIsNotNone(vts.find('vt'))
285
        vt = vts.find('vt')
286
        self.assertEqual(vt.get('id'), '1.2.3.4')
287
        modification_time = response.findall('vts/vt/modification_time')
288
        self.assertEqual(
289
            '<modification_time>19000202</modification_time>',
290
            ET.tostring(modification_time[0]).decode('utf-8'),
291
        )
292
293
    def test_get_vtss_multiple_vts(self):
@@ 245-266 (lines=22) @@
242
        vt = vts.find('vt')
243
        self.assertEqual(vt.get('id'), '1.2.3.4')
244
245
    def test_get_vts_filter_positive(self):
246
        daemon = DummyWrapper([])
247
        daemon.add_vt(
248
            '1.2.3.4',
249
            'A vulnerability test',
250
            vt_params="a",
251
            vt_modification_time='19000202',
252
        )
253
        response = secET.fromstring(
254
            daemon.handle_command(
255
                '<get_vts filter="modification_time&gt;19000201"></get_vts>'
256
            )
257
        )
258
        self.assertEqual(response.get('status'), '200')
259
        vts = response.find('vts')
260
        self.assertIsNotNone(vts.find('vt'))
261
        vt = vts.find('vt')
262
        self.assertEqual(vt.get('id'), '1.2.3.4')
263
        modification_time = response.findall('vts/vt/modification_time')
264
        self.assertEqual(
265
            '<modification_time>19000202</modification_time>',
266
            ET.tostring(modification_time[0]).decode('utf-8'),
267
        )
268
269
    def test_get_vts_filter_negative(self):