Exemplo n.º 1
0
 def test_load_yaml_string_error(self):
     try:
         load_yaml('only a string')
     except YAMLError as ex:
         assert "not a YAML dict" in str(ex)
     else:
         assert False, "expected YAMLError"
Exemplo n.º 2
0
 def test_load_yaml(self):
     doc = load_yaml("hello:\n - 1\n - 2")
     assert doc == {"hello": [1, 2]}
Exemplo n.º 3
0
 def test_load_yaml(self):
     doc = load_yaml("hello:\n - 1\n - 2")
     eq_(doc, {'hello': [1, 2]})