mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-04-20 19:38:39 +00:00
add first test of addon files
This commit is contained in:
@@ -402,6 +402,15 @@ class BaseTest(object):
|
||||
else:
|
||||
raise
|
||||
|
||||
def write_file(self, path, content):
|
||||
full_path = os.path.join(os.environ["HOME"], ".aptly", path)
|
||||
|
||||
if not os.path.exists(os.path.dirname(full_path)):
|
||||
os.makedirs(os.path.dirname(full_path), 0o755)
|
||||
|
||||
with open(full_path, "w") as f:
|
||||
f.write(content)
|
||||
|
||||
def read_file(self, path, mode=''):
|
||||
with open(os.path.join(os.environ["HOME"], self.aptlyDir, path), "r" + mode) as f:
|
||||
return f.read()
|
||||
|
||||
Reference in New Issue
Block a user