mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-11-19 21:30:10 +01:00
update tests for fixed log deployment+changelog
This commit is contained in:
parent
d665106813
commit
7fa3c34e5b
@ -14,6 +14,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
||||
([!669](https://gitlab.com/fdroid/fdroidserver/merge_requests/669))
|
||||
|
||||
### Fixed
|
||||
* fix build-logs dissapearing when deploying
|
||||
([!685](https://gitlab.com/fdroid/fdroidserver/merge_requests/685))
|
||||
* do not crash when system encoding can not be retrieved
|
||||
([!671](https://gitlab.com/fdroid/fdroidserver/merge_requests/671))
|
||||
* checkupdates: UpdateCheckIngore gets properly observed now
|
||||
|
@ -3253,6 +3253,9 @@ def deploy_build_log_with_rsync(appid, vercode, log_content):
|
||||
logging.warning(_('skip deploying full build logs: log content is empty'))
|
||||
return
|
||||
|
||||
if not os.path.exists('repo'):
|
||||
os.mkdir('repo')
|
||||
|
||||
# gzip compress log file
|
||||
log_gz_path = os.path.join('repo',
|
||||
'{pkg}_{ver}.log.gz'.format(pkg=appid,
|
||||
|
@ -1008,9 +1008,15 @@ class CommonTest(unittest.TestCase):
|
||||
|
||||
with mock.patch('subprocess.call',
|
||||
side_effect=assert_subprocess_call):
|
||||
with tempfile.TemporaryDirectory() as tmpdir, TmpCwd(tmpdir):
|
||||
fdroidserver.common.deploy_build_log_with_rsync(
|
||||
'com.example.app', '4711', mocklogcontent)
|
||||
|
||||
expected_log_path = os.path.join(tmpdir, 'repo', 'com.example.app_4711.log.gz')
|
||||
self.assertTrue(os.path.isfile(expected_log_path))
|
||||
with gzip.open(expected_log_path, 'r') as f:
|
||||
self.assertEqual(f.read(), mocklogcontent)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
os.chdir(os.path.dirname(__file__))
|
||||
|
Loading…
Reference in New Issue
Block a user