1
0
Fork 1
mirror of https://gitlab.postmarketos.org/postmarketOS/pmbootstrap.git synced 2025-07-24 13:05:09 +03:00

Run fast testcases in Travis CI, remove obsolete testcase (#760)

* Removed obsolete apkindex_files cache testcase (the corresponding
function has been removed in #345 already).
* Fix test_challenge_apk: It failed on Travis, because we're accessing
/etc/abuild.conf, which only exists after initializing the build environment.
It's a random dummy file anyway, so I've replaced it with another file.
* Fix test_folder_size: accept a tolerance in the result
This commit is contained in:
Oliver Smith 2017-10-23 19:44:08 +00:00 committed by GitHub
parent b1c86d4586
commit ed94ab7449
7 changed files with 45 additions and 27 deletions

View file

@ -26,11 +26,14 @@ import pmb.helpers.run
def folder_size(args, path):
"""
Run `du` to calculate the size of a folder (this is less code and
faster than doing the same task in pure Python).
faster than doing the same task in pure Python). This result is only
approximatelly right, but good enough for pmbootstrap's use case:
<https://github.com/postmarketOS/pmbootstrap/pull/760>
:returns: folder size in bytes
"""
output = pmb.helpers.run.root(args, ["du", "--summarize",
"--apparent-size",
"--block-size=1",
path], return_stdout=True)
ret = int(output.split("\t")[0])