test: cover the API branches nothing reached - #860
Merged
Conversation
Three untested branches in the REST API. The upload endpoint's refusal when no MIME types are configured at all: with `<filesAllowedMime>` absent, getFilesAllowedMime() answers an empty list and every upload is refused. The element has to be removed *before* the first API call rather than between calls — the config file cache invalidates on mtime, which has one-second resolution, so a rewrite mid-test races it and the second call can still read the old config. The client view endpoint's `customFields=1` arm, which requires the master password and parses the include — previously only the default path was covered. EventlogHelp::clear(), which declares no parameters. It was the last uncovered line in the API controllers.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three untested branches in the REST API.
The upload endpoint's refusal when no MIME types are configured at all: with
<filesAllowedMime>absent, getFilesAllowedMime() answers an empty list and everyupload is refused. The element has to be removed before the first API call rather
than between calls — the config file cache invalidates on mtime, which has one-second
resolution, so a rewrite mid-test races it and the second call can still read the old
config.
The client view endpoint's
customFields=1arm, which requires the master password andparses the include — previously only the default path was covered.
EventlogHelp::clear(), which declares no parameters. It was the last uncovered line in
the API controllers.