Exemplo n.º 1
0
    def test_merge_launchers_with_definitions(self):
        local_config = {'models': [{
            'name': 'model',
            'launchers': [{'framework': 'dlsdk'}],
            'datasets': [{'name': 'global_dataset'}]
        }]}

        config = ConfigReader._merge_configs(self.global_config, local_config)

        assert config['models'][0]['launchers'][0] == self.get_global_launcher('dlsdk')
Exemplo n.º 2
0
    def test_merge_datasets_with_definitions(self):
        local_config = {'models': [{
            'name': 'model',
            'launchers': [{'framework': 'dlsdk', 'model': '/absolute_path', 'weights': '/absolute_path'}],
            'datasets': [{'name': 'global_dataset'}]
        }]}

        config = ConfigReader._merge_configs(self.global_config, local_config)

        assert config['models'][0]['datasets'][0] == self.global_datasets[0]
Exemplo n.º 3
0
    def test_merge_launchers_with_model_is_not_modified(self):
        local_config = {'models': [{
            'name': 'model',
            'launchers': [{'framework': 'dlsdk', 'model': 'custom'}],
            'datasets': [{'name': 'global_dataset'}]
        }]}
        expected = self.get_global_launcher('dlsdk')
        expected['model'] = 'custom'

        config = ConfigReader._merge_configs(self.global_config, local_config)

        assert config['models'][0]['launchers'][0] == expected
Exemplo n.º 4
0
    def test_merge_datasets_with_definitions_and_meta_is_not_modified(self):
        local_config = {'models': [{
            'name': 'model',
            'launchers': [{'framework': 'dlsdk', 'model': '/absolute_path', 'weights': '/absolute_path'}],
            'datasets': [{'name': 'global_dataset', 'dataset_meta': '/absolute_path'}]
        }]}
        expected = self.global_datasets[0]
        expected['dataset_meta'] = '/absolute_path'

        config = ConfigReader._merge_configs(self.global_config, local_config)

        assert config['models'][0]['datasets'][0] == expected