1010from waveform_editor .yaml_parser import YamlParser
1111
1212
13- def test_yaml_parser_from_string ():
13+ def test_yaml_parser ():
1414 """Test loading a yaml file as a string."""
1515 # Valid YAML
1616 with open ("tests/tendencies/test_yaml/test.yaml" ) as file :
1717 yaml_file = file .read ()
1818 yaml_parser = YamlParser ()
19- yaml_parser .parse_waveforms_from_string (yaml_file )
19+ yaml_parser .parse_waveforms (yaml_file )
2020 assert_tendencies_correct (yaml_parser .waveform .tendencies )
2121 assert not yaml_parser .waveform .annotations
2222 assert not yaml_parser .has_yaml_error
@@ -25,41 +25,15 @@ def test_yaml_parser_from_string():
2525 with open ("tests/tendencies/test_yaml/test_invalid_config.yaml" ) as file :
2626 yaml_file = file .read ()
2727 yaml_parser = YamlParser ()
28- yaml_parser .parse_waveforms_from_string (yaml_file )
28+ yaml_parser .parse_waveforms (yaml_file )
2929 assert yaml_parser .waveform .annotations
3030 assert not yaml_parser .has_yaml_error
3131
3232 # Invalid YAML
3333 with open ("tests/tendencies/test_yaml/test_invalid_yaml.yaml" ) as file :
3434 yaml_file = file .read ()
3535 yaml_parser = YamlParser ()
36- yaml_parser .parse_waveforms_from_string (yaml_file )
37- assert yaml_parser .waveform .annotations
38- assert yaml_parser .has_yaml_error
39-
40-
41- def test_yaml_parser_from_file ():
42- """Test loading a yaml file as a file."""
43- # Valid YAML
44- yaml_parser = YamlParser ()
45- yaml_parser .parse_waveforms_from_file ("tests/tendencies/test_yaml/test.yaml" )
46- assert_tendencies_correct (yaml_parser .waveform .tendencies )
47- assert not yaml_parser .waveform .annotations
48- assert not yaml_parser .has_yaml_error
49-
50- # Invalid configuration
51- yaml_parser = YamlParser ()
52- yaml_parser .parse_waveforms_from_file (
53- "tests/tendencies/test_yaml/test_invalid_config.yaml"
54- )
55- assert yaml_parser .waveform .annotations
56- assert not yaml_parser .has_yaml_error
57-
58- # Invalid YAML
59- yaml_parser = YamlParser ()
60- yaml_parser .parse_waveforms_from_file (
61- "tests/tendencies/test_yaml/test_invalid_yaml.yaml"
62- )
36+ yaml_parser .parse_waveforms (yaml_file )
6337 assert yaml_parser .waveform .annotations
6438 assert yaml_parser .has_yaml_error
6539
0 commit comments