示例#1
0
def test_yaml_to_dict_file_empty():
    assert ConfigParser.yaml_to_dict(yaml_file=FILE_EMPTY) == {}
示例#2
0
def test_yaml_to_dict_file_txt():
    with pytest.raises(TypeError):
        ConfigParser.yaml_to_dict(yaml_file=FILE_TXT)
示例#3
0
def test_yaml_to_dict_file_not_found():
    with pytest.raises(FileNotFoundError):
        ConfigParser.yaml_to_dict(yaml_file=FILE_UNAVAILABLE)
示例#4
0
def test_yaml_to_dict_file_not_yaml():
    with pytest.raises(ParserError):
        ConfigParser.yaml_to_dict(yaml_file=FILE_NOT_YAML)
示例#5
0
def test_yaml_to_dict_file_ok():
    d = ConfigParser.yaml_to_dict(yaml_file=FILE_OK)
    assert type(d) is dict
    assert bool(d) is True