Code Duplication    Length = 13-14 lines in 4 locations

tests/milvus_python_test/test_config.py 4 locations

@@ 518-531 (lines=14) @@
515
        status, config_value = connect.get_config("gpu", "cache_size")
516
        assert status.OK()
517
518
    @pytest.mark.timeout(CONFIG_TIMEOUT)
519
    def test_get_search_devices_invalid_parent_key(self, connect, collection):
520
        '''
521
        target: get invalid parent key
522
        method: call get_config without parent_key: gpu
523
        expected: status not ok
524
        '''
525
        if str(connect._cmd("mode")[1]) == "CPU":
526
            pytest.skip("Only support GPU mode")
527
        invalid_configs = ["Gpu_resource_config", "gpu resource config", \
528
            "gpu_resource"]
529
        for config in invalid_configs:
530
            status, config_value = connect.get_config(config, "search_devices")
531
            assert not status.OK()
532
533
    @pytest.mark.timeout(CONFIG_TIMEOUT)
534
    def test_get_search_devices_invalid_child_key(self, connect, collection):
@@ 435-448 (lines=14) @@
432
        status, config_value = connect.get_config("gpu", "build_index_devices")
433
        assert config_value == 'gpu0'
434
435
    @pytest.mark.timeout(CONFIG_TIMEOUT)
436
    def test_get_gpu_enable_invalid_parent_key(self, connect, collection):
437
        '''
438
        target: get invalid parent key
439
        method: call get_config without parent_key: gpu
440
        expected: status not ok
441
        '''
442
        if str(connect._cmd("mode")[1]) == "CPU":
443
            pytest.skip("Only support GPU mode")
444
        invalid_configs = ["Gpu_resource_config", "gpu resource config", \
445
            "gpu_resource"]
446
        for config in invalid_configs:
447
            status, config_value = connect.get_config(config, "enable")
448
            assert not status.OK()
449
450
    @pytest.mark.timeout(CONFIG_TIMEOUT)
451
    def test_get_gpu_enable_invalid_child_key(self, connect, collection):
@@ 533-545 (lines=13) @@
530
            status, config_value = connect.get_config(config, "search_devices")
531
            assert not status.OK()
532
533
    @pytest.mark.timeout(CONFIG_TIMEOUT)
534
    def test_get_search_devices_invalid_child_key(self, connect, collection):
535
        '''
536
        target: get invalid child key
537
        method: call get_config without child_key: search_devices
538
        expected: status not ok
539
        '''
540
        if str(connect._cmd("mode")[1]) == "CPU":
541
            pytest.skip("Only support GPU mode")
542
        invalid_configs = ["Search_resources"]
543
        for config in invalid_configs:
544
            status, config_value = connect.get_config("gpu", config)
545
            assert not status.OK()
546
547
    @pytest.mark.timeout(CONFIG_TIMEOUT)
548
    def test_get_search_devices_valid(self, connect, collection):
@@ 450-462 (lines=13) @@
447
            status, config_value = connect.get_config(config, "enable")
448
            assert not status.OK()
449
450
    @pytest.mark.timeout(CONFIG_TIMEOUT)
451
    def test_get_gpu_enable_invalid_child_key(self, connect, collection):
452
        '''
453
        target: get invalid child key
454
        method: call get_config without child_key: enable
455
        expected: status not ok
456
        '''
457
        if str(connect._cmd("mode")[1]) == "CPU":
458
            pytest.skip("Only support GPU mode")
459
        invalid_configs = ["Enable", "enable ", "disable", "true"]
460
        for config in invalid_configs:
461
            status, config_value = connect.get_config("gpu", config)
462
            assert not status.OK()
463
464
    @pytest.mark.timeout(CONFIG_TIMEOUT)
465
    def test_get_gpu_enable_valid(self, connect, collection):