summaryrefslogtreecommitdiff
path: root/tests/common/config.py
blob: 94ddcd8c98839b15148cf8749253caf45c750757 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import tempfile
import os


def make_tmp(content):
    f = tempfile.NamedTemporaryFile(delete=False)
    print("make_tmp filename: " + f.name)
    f.write(bytes(content, "utf-8"))
    f.close()
    return f.name


def delete_tmp(filename):
    print("delete_tmp filename: " + filename)
    os.unlink(filename)