diff --git a/tests/test_snippets/test_adventures.py b/tests/test_snippets/test_adventures.py index b0787c0a11e..0a341c12666 100644 --- a/tests/test_snippets/test_adventures.py +++ b/tests/test_snippets/test_adventures.py @@ -73,6 +73,7 @@ def collect_snippets(path, filtered_language=None): return Hedy_snippets + # filtered_language = 'tr' # use this to filter on 1 lang, zh_Hans for Chinese, nb_NO for Norwegian, pt_PT for Portuguese @@ -113,11 +114,13 @@ def test_adventures(self, name, snippet): if fix_error: # Read English yaml file original_yaml = YamlFile.for_file('../../content/adventures/en.yaml') - original_text = original_yaml['adventures'][snippet.key]['levels'][snippet.level][snippet.field_name] + original_text = original_yaml['adventures'][snippet.key]['levels'] \ + [snippet.level][snippet.field_name] # Read broken yaml file broken_yaml = utils.load_yaml_rt(snippet.filename) - broken_yaml['adventures'][snippet.key]['levels'][snippet.level][snippet.field_name] = original_text + broken_yaml['adventures'][snippet.key]['levels'] \ + [snippet.level][snippet.field_name] = original_text with open(snippet.filename, 'w') as file: file.write(utils.dump_yaml_rt(broken_yaml))