コード例 #1
0
ファイル: test_yaml.py プロジェクト: faelenor/pygen
def test_register(add_type):
    YamlParser.register()
    assert add_type.mock_calls == [
        call('application/vnd.yaml', '.yaml'),
        call('application/vnd.yaml', '.yml'),
        call('application/x-yaml', '.yaml'),
        call('application/x-yaml', '.yml'),
        call('application/yaml', '.yaml'),
        call('application/yaml', '.yml'),
        call('text/vnd.yaml', '.yaml'),
        call('text/vnd.yaml', '.yml'),
        call('text/x-yaml', '.yaml'),
        call('text/x-yaml', '.yml'),
        call('text/yaml', '.yaml'),
        call('text/yaml', '.yml'),
    ]
コード例 #2
0
ファイル: test_yaml.py プロジェクト: faelenor/pygen
def test_loads():
    parser = YamlParser()
    result = parser.loads("[1, 2, 3]")
    assert result == [1, 2, 3]
コード例 #3
0
ファイル: test_yaml.py プロジェクト: faelenor/pygen
def test_load():
    parser = YamlParser()
    result = parser.load(StringIO("[1, 2, 3]"))
    assert result == [1, 2, 3]