mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-31 14:25:52 +00:00
parser testlib - write_file() argument adjustments
This patch modifies testlib.write_file() to take a directory and a file name instead of a path and return the joined result for callers to use if necessary. Signed-off-by: Steve Beattie <steve@nxnw.org> Acked-by: Christian Boltz <apparmor@cboltz.de>
This commit is contained in:
@@ -165,10 +165,12 @@ def touch(path):
|
||||
return os.utime(path, None)
|
||||
|
||||
|
||||
def write_file(path, contents):
|
||||
'''write contents to path'''
|
||||
def write_file(directory, file, contents):
|
||||
'''construct path, write contents to it, and return the constructed path'''
|
||||
path = os.path.join(directory, file)
|
||||
with open(path, 'w+') as f:
|
||||
f.write(contents)
|
||||
return path
|
||||
|
||||
|
||||
def keep_on_fail(unittest_func):
|
||||
|
Reference in New Issue
Block a user