python-ruamel-yaml/tests/basic/test.py

15 lines
268 B
Python
Raw Normal View History

2021-09-30 05:29:59 +00:00
#! /usr/bin/python3
import sys
import os
from ruamel.yaml import YAML
f = open(os.path.abspath(os.path.join(os.path.dirname(__file__),'..', 'tests.yml')), 'r')
s = f.read()
f.close()
yaml = YAML()
data = yaml.load(s)
if data[0]['hosts'] != 'localhost':
exit(1)