Пример #1
0
def test_Schema_to_file_configobj(simple_schema, tmp_text_file):
    simple_schema.to_file(filename=tmp_text_file.name, fmt="configobj")
    tmp_text_file.flush()
    tmp_text_file.seek(0)
    serialization = tmp_text_file.read()
    assert serialization == SIMPLE_SCHEMA_CONFIGOBJ_SERIALIZATION
Пример #2
0
def test_Schema_to_file_zirkon(simple_schema, tmp_text_file):
    simple_schema.to_file(filename=tmp_text_file.name, protocol="zirkon")
    tmp_text_file.flush()
    tmp_text_file.seek(0)
    serialization = tmp_text_file.read()
    assert serialization == SIMPLE_SCHEMA_ZIRKON_SERIALIZATION
Пример #3
0
def test_Schema_to_file_json(simple_schema, tmp_text_file):
    simple_schema.to_file(filename=tmp_text_file.name, fmt="json")
    tmp_text_file.flush()
    tmp_text_file.seek(0)
    serialization = tmp_text_file.read()
    assert serialization == SIMPLE_SCHEMA_JSON_SERIALIZATION
Пример #4
0
def test_Schema_to_file_configobj(simple_schema, tmp_text_file):
    simple_schema.to_file(filename=tmp_text_file.name, protocol="configobj")
    tmp_text_file.flush()
    tmp_text_file.seek(0)
    serialization = tmp_text_file.read()
    assert serialization == SIMPLE_SCHEMA_CONFIGOBJ_SERIALIZATION