summaryrefslogtreecommitdiffstats
path: root/debian/tests/data/test-yaml.py
blob: 311a3f8ac2b5a1fea2e8ed486325c1e1480d4cf7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# very crude smoke test of the yaml package

from ruamel.yaml import YAML


def test_load_clib():
    import ruamel.yaml.cyaml

def test_safe_load():
    yaml = YAML(typ="safe", pure=False)
    with open("test-yaml.yaml") as fh:
        y = yaml.load(fh)

    assert len(y['testdata']) == 2

    assert len(y['testdata']['test1']) == 3

    assert len(y['testdata']['test-data-2']) == 2


if __name__ == "__main__":
    test_safe_load()
    print("Complete.")