Exemplo n.º 1
0
def test_create_existing_file():
    with pytest.raises(IOError):
        create_file(EMPTY_TEMP_FILE, TEMP_FILE_CONTENT)
Exemplo n.º 2
0
def test_create_file():
    create_file(TEMP_FILE_WITH_CONTENT, TEMP_FILE_CONTENT)
    assert path_exists(TEMP_FILE_WITH_CONTENT) is True
    assert read_file(TEMP_FILE_WITH_CONTENT) == TEMP_FILE_CONTENT
Exemplo n.º 3
0
def test_read_existing_file():
    create_file(TEMP_FILE_WITH_CONTENT, TEMP_FILE_CONTENT)
    assert read_file(TEMP_FILE_WITH_CONTENT) == TEMP_FILE_CONTENT
Exemplo n.º 4
0
def _copy_file_and_replace_keywords(dst, template, args):
    content = _format_template(template, args)
    create_file(dst, content)
Exemplo n.º 5
0
def create_temp_file_with_content():
    create_file(TEMP_FILE_WITH_CONTENT, TEMP_FILE_CONTENT)
Exemplo n.º 6
0
def create_empty_temp_file():
    create_file(EMPTY_TEMP_FILE)