summaryrefslogtreecommitdiff
path: root/gitlab/tests/test_utils.py
Commit message (Collapse)AuthorAgeFilesLines
* chore: move 'gitlab/tests/' dir to 'tests/unit/'John L. Villalovos2021-05-261-42/+0
| | | | | Move the 'gitlab/tests/' directory to 'tests/unit/' so we have all the tests located under the 'tests/' directory.
* chore: remove unused function sanitize_parameters()John L. Villalovos2021-04-181-20/+0
| | | | | | The function sanitize_parameters() was used when the v3 API was in use. Since v3 API support has been removed there are no more users of this function.
* fix: handle tags like debian/2%2.6-21 as identifiersEmanuele Aina2021-03-051-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | Git refnames are relatively free-form and can contain all sort for special characters, not just `/` and `#`, see http://git-scm.com/docs/git-check-ref-format In particular, Debian's DEP-14 standard for storing packaging in git repositories mandates the use of the `%` character in tags in some cases like `debian/2%2.6-21`. Unfortunately python-gitlab currently only escapes `/` to `%2F` and in some cases `#` to `%23`. This means that when using the commit API to retrieve information about the `debian/2%2.6-21` tag only the slash is escaped before being inserted in the URL path and the `%` is left untouched, resulting in something like `/api/v4/projects/123/repository/commits/debian%2F2%2.6-21`. When urllib3 seees that it detects the invalid `%` escape and then urlencodes the whole string, resulting in `/api/v4/projects/123/repository/commits/debian%252F2%252.6-21`, where the original `/` got escaped twice and produced `%252F`. To avoid the issue, fully urlencode identifiers and parameters to avoid the urllib3 auto-escaping in all cases. Signed-off-by: Emanuele Aina <emanuele.aina@collabora.com>
* refactor: split unit tests by GitLab API resourcesNejc Habjan2020-08-221-17/+31
|
* chore: run unittest2pytest on all unit testsNejc Habjan2020-08-221-4/+4
|
* feat(test): unused unittest2, type -> isinstanceCyril Jouve2019-10-131-4/+1
|
* fix: convert # to %23 in URLsfix/779Gauvain Pocentek2019-06-081-0/+43
Refactor a bit to handle this change, and add unit tests. Closes #779