summaryrefslogtreecommitdiff
path: root/tests/utils
Commit message (Collapse)AuthorAgeFilesLines
* test/utils/savefile.py: Stringify the tmpdir so that tests work.fix-savefile-test-brokenTristan Van Berkom2018-01-061-9/+9
| | | | | | | | | It looks like this newly added test assumes the user has a very recent version of pytest, which supports treating the `tmpdir` fixture like a string. A reasonable alternative to this patch would be require at minimum a version of pytest which supports this newly introduced API.
* utils.py: Add save_file_atomic() helperSam Thursfield2018-01-042-0/+62
This is a context manager that can be used to divert file writes into a temporary file, which is then renamed into place once writing is complete. It is primarily intended for use by source plugins which download files, so they can ensure that their downloads appear atomic and there is no risk of leaving half-downloaded files in the cache. So far this is not used in the core, but it is needed by the Docker source plugin that is proposed for the bst-external plugins repo. See: https://gitlab.com/BuildStream/bst-external/merge_requests/9