예제 #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]
예제 #2
0
 def test_load(self):
     assert utils.yaml_load("[1, 2]") == [1, 2]
예제 #3
0
 def test_load_float_bug(self):
     try:
         utils.yaml_load("._")
     except yaml.YAMLError:
         # Either no exception or YAMLError, not ValueError
         pass
예제 #4
0
 def test_load_float_bug(self):
     with pytest.raises(yaml.YAMLError):
         utils.yaml_load("._")
예제 #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]
예제 #6
0
 def test_load(self):
     assert utils.yaml_load("[1, 2]") == [1, 2]