summaryrefslogtreecommitdiff
path: root/tests/sources/zip.py
Commit message (Collapse)AuthorAgeFilesLines
* testing: Add functions to generate yaml filesThomas Coldrick2020-01-241-19/+9
| | | | | | | Adds functions to the `buildstream.testing` package to allow plugins to dump elements and projects on the fly. Before this plugins were just accessing the private yaml API for tests and loading/dumping directly. I also allow access to just `_yaml.load()` from testing.
* exceptions: Expose ErrorDomain, ErrorLoadReasonThomas Coldrick2020-01-231-1/+1
| | | | | | | Plugin tests are already accessing this API, but using imports from private modules. For motivation for this to be exposed publicly, note that ErrorDomain is an argument for most things in runcli.py, and LoadErrorReason may be another.
* Reformat code using BlackChandan Singh2019-11-141-64/+45
| | | | | | | As discussed over the mailing list, reformat code using Black. This is a one-off change to reformat all our codebase. Moving forward, we shouldn't expect such blanket reformats. Rather, we expect each change to already comply with the Black formatting style.
* tests: Change all calls to _yaml.dump to _yaml.rountrip_dumpBenjamin Schubert2019-07-151-2/+2
| | | | | Now that both are equivalent, we can skip the sanitization part before the yaml call.
* plugintestutils: Rename 'plugintestutils' package to 'testing'phil/rename-plugintestutilsPhil Dawson2019-04-161-1/+1
| | | | | | | | | - Rename plugintestutils to testing. - Don't run the tests from bst-plugins-template. This imports buildstream.plugintestutils so will have to be disabled to get through CI. This can be re nabled once bst-plugins-template has been patched.
* tests: str(datafiles) instead of a longer thingAngelos Evripiotis2019-03-211-7/+7
| | | | | | | | | | | | | | | | | | | Replace some popular copypasta. This important-looking invocation: os.path.join(datafiles.dirname, datafiles.basename) is equivalent to this shorter invocation: project = str(datafiles) It seems like it's very popular copypasta, replace it with the shorter one thus: # Use 'gsed' or 'sed' etc. as appropriate for your system. git config --global alias.sub '!f() { git grep --name-only --null "$1" | gxargs --null gsed --in-place --expression "s/$1/$2/g" ; }; f' git sub 'os.path.join(datafiles.dirname, datafiles.basename)' 'str(datafiles)'
* tests:lint: disable 'unused-import' checks on pytest fixturesBenjamin Schubert2019-03-201-1/+1
| | | | | Pylint can't know that pytest's fixtures are used in a file and therefore reports false positives. Silencing all those errors
* tests:lint: silence redefined-outer-name in files using fixturesBenjamin Schubert2019-03-201-0/+3
| | | | | Pylint doesn't play well with pytest fixtures, we therefore need to silence this error.
* tests:lint: rename variables shadowing othersBenjamin Schubert2019-03-201-2/+2
|
* tests:lint: remove all unneccessary-parens errors from pylintBenjamin Schubert2019-03-201-4/+4
|
* tests:lint: reorder imports for consistencyBenjamin Schubert2019-03-201-1/+2
| | | | | - Remove all wrong-import-order from pylint - Order some subgroups of imports
* Expose basic api for testing external plugins.phil/plugin-testing-apiPhil Dawson2019-02-081-1/+1
| | | | | | | | | | | | | | | | | | We want external plugins to be able to make use of the core testing utils. This commit exposes the basic utilities which are currently in use in bst-external plugins. If necessary, more utilities could be exposed in the future. Moves the following files from tests/testutils/ to buildstream/plugintestingutils/: o runcli.py o integration.py As part of this, this commit makes the following changes to runcli.py and integration.py: o runcli.py: Fix linting errors o runcli.py: Add user facing documentation o Integration.py: Add user facing documentation
* Mark 'old' checkout command as obsoleteJames Ennis2019-01-221-4/+4
| | | | | | | | | | | This commit marks 'bst checkout' as a 'hidden' command. If used, the user will be prompted to use the new 'bst artifact checkout' command. All tests which used 'bst checkout' have been modified to use the new artifact sub-command. This partially solves #822.
* Introduce new "source" command groupChandan Singh2018-12-141-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Following the message thread https://mail.gnome.org/archives/buildstream-list/2018-November/msg00106.html, implement a new command group called `source`. Move existing `track`, `fetch`, and the recently added `source-checkout` commands under this group. For `track` and `fetch`, this is a BREAKING change, as the old commands have been marked as obsolete. Using them will result in an error message that refers people to use the new versions, like `bst source fetch` instead of old `bst fetch`. `source-checkout` will now become `source checkout` (the dash has turned into a space), and is not a breaking change as it was added in the current development cycle. Note that the functionality to hide commands from help output was added only recently in Click, so the minimum version of Click that we now require is 7.0. Summary of changes: * _frontend/cli.py: Add `source` command group, mark previous versions as obsolete and hide them from the help output. * _frontend/complete.py: Fix completion for hidden commands. * setup.py: Bump Click minimum version to 7.0. * tests: Update to cope with the new command names. Fixes #814.
* Add support for .netrc in remote/tar/zip pluginsValentin David2018-11-291-0/+52
| | | | Fixes #723.
* tests: Modify tests to ensure retry FAILUREJosh Smith2018-08-311-1/+1
|
* tests/sources: deb, tar and zip all test for retry behaviourJosh Smith2018-07-271-1/+2
| | | | | | This is following 5d6418a06a3a0262df5f6b9e6e1a36578515fd4a where DownloadableFileSource was modified to raise 'temporary' errors when relating to file downloading.
* Move _list_dir_contents to __init__.pyMove-_list_dir_contents-to-__init__425-add-a-deps-flag-to-bst-checkoutPhillip Smyth2018-07-111-16/+7
|
* _stream.py: Add StreamError exceptionTristan Van Berkom2018-05-081-2/+2
| | | | Use Stream error for Stream errors.
* tests/sources: Use new error checking tools for source testsTristan Van Berkom2018-01-011-20/+18
| | | | | | Also added a test case for the `patch` plugin which checks for graceful failure when the specified patch file is not a regular file (but a block device or a named pipe instead).
* Adapting test cases to expect logs in stderrTristan Van Berkom2017-12-131-1/+1
| | | | And also adapted them to remove any occurrences of HAVE_ROOT.
* Remove unused imports in test filesGökçen Nurlu2017-12-071-1/+1
|
* tests/sources/zip.py: Adding tests for zip source edge casesTristan Van Berkom2017-11-061-0/+188