summaryrefslogtreecommitdiff
path: root/test/units
diff options
context:
space:
mode:
authorBrian Coca <bcoca@users.noreply.github.com>2022-06-24 13:26:31 -0400
committerGitHub <noreply@github.com>2022-06-24 13:26:31 -0400
commitfa35aa4865780cd0ddbcc060f9e95e59e1c1646b (patch)
tree7f2ca4f9e527f5970dee6216f68a42d396140ff9 /test/units
parente481b35e23caf7040aa2748911195c9c66576859 (diff)
downloadansible-fa35aa4865780cd0ddbcc060f9e95e59e1c1646b.tar.gz
Galaxy server config updates (#77106)
* ansible-galaxy configurable timeouts - also fixed issues with precedence, so --ignore-certs now overrides config - made galaxy_timeout generic setting, if set, it becomes default for server configs, but now specific servers can override - updated tests or added notes (some tests ignore/override precedence) Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
Diffstat (limited to 'test/units')
-rw-r--r--test/units/galaxy/test_collection.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/test/units/galaxy/test_collection.py b/test/units/galaxy/test_collection.py
index 0286e0b36d..80696df63c 100644
--- a/test/units/galaxy/test_collection.py
+++ b/test/units/galaxy/test_collection.py
@@ -363,6 +363,8 @@ def test_validate_certs_with_server_url(global_ignore_certs, monkeypatch):
@pytest.mark.parametrize('global_ignore_certs', [True, False])
def test_validate_certs_with_server_config(global_ignore_certs, server_config, monkeypatch):
+
+ # test sidesteps real resolution and forces the server config to override the cli option
get_plugin_options = MagicMock(side_effect=server_config)
monkeypatch.setattr(C.config, 'get_plugin_options', get_plugin_options)
@@ -380,9 +382,10 @@ def test_validate_certs_with_server_config(global_ignore_certs, server_config, m
monkeypatch.setattr(galaxy_cli, '_execute_install_collection', mock_execute_install)
galaxy_cli.run()
- assert galaxy_cli.api_servers[0].validate_certs is False
- assert galaxy_cli.api_servers[1].validate_certs is True
- assert galaxy_cli.api_servers[2].validate_certs is not global_ignore_certs
+ # server cfg, so should match def above, if not specified so it should use default (true)
+ assert galaxy_cli.api_servers[0].validate_certs is server_config[0].get('validate_certs', True)
+ assert galaxy_cli.api_servers[1].validate_certs is server_config[1].get('validate_certs', True)
+ assert galaxy_cli.api_servers[2].validate_certs is server_config[2].get('validate_certs', True)
def test_build_collection_no_galaxy_yaml():