tests: use context manager and/or standard setup temp files

This commit is contained in:
Jochen Sprickerhof 2022-11-22 17:17:45 +01:00 committed by Hans-Christoph Steiner
parent 1eeb992118
commit d29a486e31
12 changed files with 465 additions and 680 deletions

View file

@ -122,6 +122,7 @@ class NightlyTest(unittest.TestCase):
assert '-----BEGIN RSA PRIVATE KEY-----' in fp.read()
with open(ssh_private_key_file + '.pub') as fp:
assert fp.read(8) == 'ssh-rsa '
shutil.rmtree(os.path.dirname(ssh_private_key_file))
@patch.dict(os.environ, clear=True)
@patch('sys.argv', ['fdroid nightly', '--verbose'])