Exemplo n.º 1
0
 def test_load_file(self, tmpdir):
     tmpfile = tmpdir / 'foo.yml'
     tmpfile.write('[1, 2]')
     with tmpfile.open(encoding='utf-8') as f:
         assert utils.yaml_load(f) == [1, 2]
Exemplo n.º 2
0
 def test_load(self):
     assert utils.yaml_load("[1, 2]") == [1, 2]
Exemplo n.º 3
0
 def test_load_float_bug(self):
     try:
         utils.yaml_load("._")
     except yaml.YAMLError:
         # Either no exception or YAMLError, not ValueError
         pass
Exemplo n.º 4
0
 def test_load_float_bug(self):
     with pytest.raises(yaml.YAMLError):
         utils.yaml_load("._")
Exemplo n.º 5
0
 def test_load_file(self, tmpdir):
     tmpfile = tmpdir / 'foo.yml'
     tmpfile.write('[1, 2]')
     with tmpfile.open(encoding='utf-8') as f:
         assert utils.yaml_load(f) == [1, 2]
Exemplo n.º 6
0
 def test_load(self):
     assert utils.yaml_load("[1, 2]") == [1, 2]