mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Also: - Rename `FooBarTestCase` test classes as `TestFooBar`. These were collected by pytest only because they were `unittest.TestCase` derived, but normally pytest collects only test classes whose name starts with `Test`, see https://docs.pytest.org/en/7.1.x/reference/reference.html#confval-python_classes
37 lines
1.1 KiB
Python
37 lines
1.1 KiB
Python
"""
|
|
You may run this test using the following command:
|
|
./run_tests.sh test/integration/cloudauthz/test_cloudauthz.py:TestDefineCloudAuthz.test_post_cloudauthz_without_authn -s
|
|
"""
|
|
|
|
import json
|
|
|
|
from galaxy_test.driver import integration_util
|
|
|
|
|
|
class TestDefineCloudAuthz(integration_util.IntegrationTestCase):
|
|
framework_tool_and_types = True
|
|
|
|
def test_post_cloudauthz_without_authn(self):
|
|
"""
|
|
This test asserts if a cloudauthz object
|
|
can be successfully posted to the cloudauthz API
|
|
(i.e., api/cloud/authz).
|
|
"""
|
|
provider = "azure"
|
|
tenant_id = "abc"
|
|
client_id = "def"
|
|
client_secret = "ghi"
|
|
with self._different_user("vahid@test.com"):
|
|
|
|
# The payload for the POST API.
|
|
payload = {
|
|
"provider": provider,
|
|
"config": json.dumps({"tenant_id": tenant_id, "client_id": client_id, "client_secret": client_secret}),
|
|
}
|
|
|
|
response = self._post(path="cloud/authz", data=payload)
|
|
response.raise_for_status()
|
|
cloudauthz = response.json()
|
|
|
|
assert cloudauthz["provider"] == provider
|