()
| 60 | |
| 61 | |
| 62 | def test_variables(): |
| 63 | yaml_config = """ |
| 64 | $foo: !pw.tests.test_yaml.Foo |
| 65 | a: 1 |
| 66 | c: "bar" |
| 67 | |
| 68 | bar: !pw.tests.test_yaml.Bar |
| 69 | d: $foo |
| 70 | """ |
| 71 | |
| 72 | d = load_yaml(yaml_config) |
| 73 | assert "bar" in d.keys() |
| 74 | assert d["bar"] == Bar(Foo(a=1, c="bar")) |
| 75 | |
| 76 | yaml_config2 = """ |
| 77 | foo: !pw.tests.test_yaml.Foo |
| 78 | a: 1 |
| 79 | c: "bar" |
| 80 | |
| 81 | bar: !pw.tests.test_yaml.Bar |
| 82 | d: foo |
| 83 | """ |
| 84 | |
| 85 | d = load_yaml(yaml_config2) |
| 86 | assert "bar" in d.keys() |
| 87 | assert d["bar"] == Bar("foo") |
| 88 | |
| 89 | |
| 90 | def test_typo_in_key(): |