ansible/test/units/galaxy
Toshio Kuratomi 4cad7e479c
Galaxy publish fix (#63580)
* Handle galaxy v2/v3 API diffs for artifact publish response

For publishing a collection artifact
(POST /v3/collections/artifacts/), the response
format is different between v2 and v3.

For v2 galaxy, the 'task' url returned is
a full url with scheme:

        {"task": "https://galaxy-dev.ansible.com/api/v2/collection-imports/35573/"}

For v3 galaxy, the task url is relative:

        {"task": "/api/automation-hub/v3/imports/collections/838d1308-a8f4-402c-95cb-7823f3806cd8/"}

So check which API we are using and update the task url approriately.

* Use full url for all wait_for_import messages

Update unit tests to parameterize the expected
responses and urls.

* update explanatory comment

* Rename n_url to full_url.

* Fix issue with overwrite of the complete path

* Fixes overwrite of the complete path in case there's extra path stored
  in self.api_sever
* Normalizes the input to the wait_import_task function so it receives
  the same value on both v2 and v3

Builds on #63523

* Update unittests for new call signature

* Add changelog for ansible-galaxy publish API fixes.
2019-10-16 15:23:12 -07:00
..
__init__.py Collection test (#59488) 2019-07-24 12:38:32 +10:00
test_api.py Galaxy publish fix (#63580) 2019-10-16 15:23:12 -07:00
test_collection.py Galaxy publish fix (#63580) 2019-10-16 15:23:12 -07:00
test_collection_install.py Add support for automation-hub authentication to ansible-galaxy (#63031) 2019-10-04 17:57:37 -04:00
test_token.py ansible-galaxy - define multiple galaxy instances in ansible.cfg (#60553) 2019-08-21 07:49:05 +10:00