Пример #1
0
    def test_read_configs_without_global_config(self, mocker):
        config = {'models': [{
            'name': 'model',
            'launchers': [{'framework': 'dlsdk', 'model': '/absolute_path', 'weights': '/absolute_path'}],
            'datasets': [{'name': 'global_dataset'}]
        }]}
        empty_args = Namespace(**{
            'models': None, 'extensions': None, 'source': None, 'annotations': None,
            'converted_models': None, 'model_optimizer': None, 'bitstreams': None,
            'definitions': None, 'config': None,'stored_predictions': None,'tf_custom_op_config': None,
            'progress': 'bar', 'target_framework': None, 'target_devices': None, 'log_file': None
        })
        mocker.patch('accuracy_checker.utils.get_path', return_value=Path.cwd())
        mocker.patch('yaml.load', return_value=config)
        mocker.patch('pathlib.Path.open')

        _, local_config = ConfigReader._read_configs(empty_args)

        assert config == local_config
Пример #2
0
    def test_read_configs_without_global_config(self, mocker):
        config = {
            'models': [{
                'name':
                'model',
                'launchers': [{
                    'framework': 'dlsdk',
                    'model': '/absolute_path',
                    'weights': '/absolute_path'
                }],
                'datasets': [{
                    'name': 'global_dataset'
                }]
            }]
        }
        empty_args = Namespace(
            **{
                'root': None,
                'models': None,
                'extensions': None,
                'source': None,
                'annotations': None,
                'converted_models': None,
                'model_optimizer': None,
                'bitstreams': None,
                'definitions': None,
                'config': None
            })
        mocker.patch('accuracy_checker.config.config_reader.check_exists',
                     return_value=pathlib.Path.cwd())
        mocker.patch('yaml.load', return_value=config)
        mocker.patch('pathlib.Path.open')

        _, local_config = ConfigReader._read_configs(empty_args)

        assert config == local_config