test: coverage report #880
81 tests run, 68 passed, 5 skipped, 8 failed.
Annotations
Check failure on line 41 in tests/jms/test_algorithms.py
github-actions / Test Report ubuntu-latest:3.10
test_algorithms
ansys.hps.client.exceptions.APIError: 503 Server Error: Service Unavailable for: POST https://localhost:8443/rep/jms/api/v1/projects/?fields=all
Raw output
client = <ansys.hps.client.client.Client object at 0x7fbc2f830a90>
def test_algorithms(client):
log.debug("=== Client ===")
client = client
jms_api = JmsApi(client)
proj_name = f"rep_client_test_jms_AlgorithmsTest"
proj = Project(name=proj_name, active=True)
> proj = jms_api.create_project(proj, replace=True)
tests/jms/test_algorithms.py:41:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/ansys/hps/client/jms/api/jms_api.py:120: in create_project
return create_project(self.client, self.url, project, replace, as_objects)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/ansys/hps/client/jms/api/jms_api.py:334: in create_project
r = client.session.post(f"{url}", data=json_data)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/requests/sessions.py:637: in post
return self.request("POST", url, data=data, json=json, **kwargs)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/requests/sessions.py:589: in request
resp = self.send(prep, **send_kwargs)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/requests/sessions.py:710: in send
r = dispatch_hook("response", hooks, r, **kwargs)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/requests/hooks.py:30: in dispatch_hook
_hook_data = hook(hook_data, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
response = <Response [503]>, args = ()
kwargs = {'cert': None, 'proxies': OrderedDict(), 'stream': False, 'timeout': None, ...}
r_content = {}, reason = 'Service Unavailable', description = None
error_msg = '503 Server Error: Service Unavailable for: POST https://localhost:8443/rep/jms/api/v1/projects/?fields=all'
def raise_for_status(response, *args, **kwargs):
"""Automatically checks HTTP errors.
This method mimics the requests.Response.raise_for_status() method.
"""
if 400 <= response.status_code < 600:
r_content = {}
try:
r_content = response.json()
except ValueError:
pass
reason = r_content.get("title", None) # jms api
if not reason:
reason = r_content.get("error", None) # auth api
if not reason:
reason = response.reason
description = r_content.get("description", None) # jms api
if not description:
description = r_content.get("error_description", None) # auth api
if 400 <= response.status_code < 500:
error_msg = "%s Client Error: %s for: %s %s" % (
response.status_code,
reason,
response.request.method,
response.url,
)
if description:
error_msg += f"\n{description}"
raise ClientError(error_msg, reason=reason, description=description, response=response)
elif 500 <= response.status_code < 600:
error_msg = "%s Server Error: %s for: %s %s" % (
response.status_code,
reason,
response.request.method,
response.url,
)
if description:
error_msg += f"\n{description}"
> raise APIError(error_msg, reason=reason, description=description, response=response)
E ansys.hps.client.exceptions.APIError: 503 Server Error: Service Unavailable for: POST https://localhost:8443/rep/jms/api/v1/projects/?fields=all
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/ansys/hps/client/exceptions.py:105: APIError
Check failure on line 39 in tests/jms/test_files.py
github-actions / Test Report ubuntu-latest:3.10
test_files
ansys.hps.client.exceptions.APIError: 503 Server Error: Service Unavailable for: POST https://localhost:8443/rep/jms/api/v1/projects/?fields=all
Raw output
client = <ansys.hps.client.client.Client object at 0x7fbc2f830a90>
def test_files(client):
jms_api = JmsApi(client)
> proj = jms_api.create_project(
Project(name=f"rep_client_test_jms_FilesTest", active=False), replace=True
)
tests/jms/test_files.py:39:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/ansys/hps/client/jms/api/jms_api.py:120: in create_project
return create_project(self.client, self.url, project, replace, as_objects)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/ansys/hps/client/jms/api/jms_api.py:334: in create_project
r = client.session.post(f"{url}", data=json_data)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/requests/sessions.py:637: in post
return self.request("POST", url, data=data, json=json, **kwargs)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/requests/sessions.py:589: in request
resp = self.send(prep, **send_kwargs)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/requests/sessions.py:710: in send
r = dispatch_hook("response", hooks, r, **kwargs)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/requests/hooks.py:30: in dispatch_hook
_hook_data = hook(hook_data, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
response = <Response [503]>, args = ()
kwargs = {'cert': None, 'proxies': OrderedDict(), 'stream': False, 'timeout': None, ...}
r_content = {}, reason = 'Service Unavailable', description = None
error_msg = '503 Server Error: Service Unavailable for: POST https://localhost:8443/rep/jms/api/v1/projects/?fields=all'
def raise_for_status(response, *args, **kwargs):
"""Automatically checks HTTP errors.
This method mimics the requests.Response.raise_for_status() method.
"""
if 400 <= response.status_code < 600:
r_content = {}
try:
r_content = response.json()
except ValueError:
pass
reason = r_content.get("title", None) # jms api
if not reason:
reason = r_content.get("error", None) # auth api
if not reason:
reason = response.reason
description = r_content.get("description", None) # jms api
if not description:
description = r_content.get("error_description", None) # auth api
if 400 <= response.status_code < 500:
error_msg = "%s Client Error: %s for: %s %s" % (
response.status_code,
reason,
response.request.method,
response.url,
)
if description:
error_msg += f"\n{description}"
raise ClientError(error_msg, reason=reason, description=description, response=response)
elif 500 <= response.status_code < 600:
error_msg = "%s Server Error: %s for: %s %s" % (
response.status_code,
reason,
response.request.method,
response.url,
)
if description:
error_msg += f"\n{description}"
> raise APIError(error_msg, reason=reason, description=description, response=response)
E ansys.hps.client.exceptions.APIError: 503 Server Error: Service Unavailable for: POST https://localhost:8443/rep/jms/api/v1/projects/?fields=all
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/ansys/hps/client/exceptions.py:105: APIError
Check failure on line 137 in tests/jms/test_files.py
github-actions / Test Report ubuntu-latest:3.10
test_files.test_download_file_in_subdir
ansys.hps.client.exceptions.APIError: 503 Server Error: Service Unavailable for: POST https://localhost:8443/rep/jms/api/v1/projects/?fields=all
Raw output
client = <ansys.hps.client.client.Client object at 0x7fbc2f830a90>
def test_download_file_in_subdir(client):
jms_api = JmsApi(client)
> proj = jms_api.create_project(Project(name=f"rep_test_download_file_in_subdir", active=False))
tests/jms/test_files.py:137:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/ansys/hps/client/jms/api/jms_api.py:120: in create_project
return create_project(self.client, self.url, project, replace, as_objects)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/ansys/hps/client/jms/api/jms_api.py:334: in create_project
r = client.session.post(f"{url}", data=json_data)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/requests/sessions.py:637: in post
return self.request("POST", url, data=data, json=json, **kwargs)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/requests/sessions.py:589: in request
resp = self.send(prep, **send_kwargs)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/requests/sessions.py:710: in send
r = dispatch_hook("response", hooks, r, **kwargs)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/requests/hooks.py:30: in dispatch_hook
_hook_data = hook(hook_data, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
response = <Response [503]>, args = ()
kwargs = {'cert': None, 'proxies': OrderedDict(), 'stream': False, 'timeout': None, ...}
r_content = {}, reason = 'Service Unavailable', description = None
error_msg = '503 Server Error: Service Unavailable for: POST https://localhost:8443/rep/jms/api/v1/projects/?fields=all'
def raise_for_status(response, *args, **kwargs):
"""Automatically checks HTTP errors.
This method mimics the requests.Response.raise_for_status() method.
"""
if 400 <= response.status_code < 600:
r_content = {}
try:
r_content = response.json()
except ValueError:
pass
reason = r_content.get("title", None) # jms api
if not reason:
reason = r_content.get("error", None) # auth api
if not reason:
reason = response.reason
description = r_content.get("description", None) # jms api
if not description:
description = r_content.get("error_description", None) # auth api
if 400 <= response.status_code < 500:
error_msg = "%s Client Error: %s for: %s %s" % (
response.status_code,
reason,
response.request.method,
response.url,
)
if description:
error_msg += f"\n{description}"
raise ClientError(error_msg, reason=reason, description=description, response=response)
elif 500 <= response.status_code < 600:
error_msg = "%s Server Error: %s for: %s %s" % (
response.status_code,
reason,
response.request.method,
response.url,
)
if description:
error_msg += f"\n{description}"
> raise APIError(error_msg, reason=reason, description=description, response=response)
E ansys.hps.client.exceptions.APIError: 503 Server Error: Service Unavailable for: POST https://localhost:8443/rep/jms/api/v1/projects/?fields=all
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/ansys/hps/client/exceptions.py:105: APIError
Check failure on line 140 in tests/jms/test_fitness_definition.py
github-actions / Test Report ubuntu-latest:3.10
test_fitness_definition.test_fitness_definition_integration
ansys.hps.client.exceptions.APIError: 503 Server Error: Service Unavailable for: POST https://localhost:8443/rep/jms/api/v1/projects/?fields=all
Raw output
client = <ansys.hps.client.client.Client object at 0x7fbc2f830a90>
def test_fitness_definition_integration(client):
proj_name = f"test_jms_FitnessDefinitionTest"
proj = Project(name=proj_name, active=True)
jms_api = JmsApi(client)
> proj = jms_api.create_project(proj, replace=True)
tests/jms/test_fitness_definition.py:140:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/ansys/hps/client/jms/api/jms_api.py:120: in create_project
return create_project(self.client, self.url, project, replace, as_objects)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/ansys/hps/client/jms/api/jms_api.py:334: in create_project
r = client.session.post(f"{url}", data=json_data)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/requests/sessions.py:637: in post
return self.request("POST", url, data=data, json=json, **kwargs)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/requests/sessions.py:589: in request
resp = self.send(prep, **send_kwargs)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/requests/sessions.py:710: in send
r = dispatch_hook("response", hooks, r, **kwargs)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/requests/hooks.py:30: in dispatch_hook
_hook_data = hook(hook_data, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
response = <Response [503]>, args = ()
kwargs = {'cert': None, 'proxies': OrderedDict(), 'stream': False, 'timeout': None, ...}
r_content = {}, reason = 'Service Unavailable', description = None
error_msg = '503 Server Error: Service Unavailable for: POST https://localhost:8443/rep/jms/api/v1/projects/?fields=all'
def raise_for_status(response, *args, **kwargs):
"""Automatically checks HTTP errors.
This method mimics the requests.Response.raise_for_status() method.
"""
if 400 <= response.status_code < 600:
r_content = {}
try:
r_content = response.json()
except ValueError:
pass
reason = r_content.get("title", None) # jms api
if not reason:
reason = r_content.get("error", None) # auth api
if not reason:
reason = response.reason
description = r_content.get("description", None) # jms api
if not description:
description = r_content.get("error_description", None) # auth api
if 400 <= response.status_code < 500:
error_msg = "%s Client Error: %s for: %s %s" % (
response.status_code,
reason,
response.request.method,
response.url,
)
if description:
error_msg += f"\n{description}"
raise ClientError(error_msg, reason=reason, description=description, response=response)
elif 500 <= response.status_code < 600:
error_msg = "%s Server Error: %s for: %s %s" % (
response.status_code,
reason,
response.request.method,
response.url,
)
if description:
error_msg += f"\n{description}"
> raise APIError(error_msg, reason=reason, description=description, response=response)
E ansys.hps.client.exceptions.APIError: 503 Server Error: Service Unavailable for: POST https://localhost:8443/rep/jms/api/v1/projects/?fields=all
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/ansys/hps/client/exceptions.py:105: APIError
Check failure on line 287 in tests/jms/test_projects.py
github-actions / Test Report ubuntu-latest:3.10
test_projects.test_copy_exec_script
ansys.hps.client.exceptions.APIError: 500 Server Error: Copy failed for: POST https://localhost:8443/hps/fs/api/v1/default_execution_scripts/mapdl-v241-exec_mapdl.py:copy?fields=all
Copying ansfs://default_execution_scripts/mapdl-v241-exec_mapdl.py failed
Raw output
client = <ansys.hps.client.client.Client object at 0x7fbc2f830a90>
def test_copy_exec_script(client):
jms_api = JmsApi(client)
proj_name = f"test_copy_exec_script"
proj = Project(name=proj_name)
proj = jms_api.create_project(proj)
project_api = ProjectApi(client, proj.id)
ansys_short_version = f"v{ansys_version[2:4]}{ansys_version[6]}"
script_name = f"mapdl-{ansys_short_version}-exec_mapdl"
> file = project_api.copy_default_execution_script(f"{script_name}.py")
tests/jms/test_projects.py:287:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/ansys/hps/client/jms/api/project_api.py:531: in copy_default_execution_script
checksum = _fs_copy_file(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/ansys/hps/client/jms/api/project_api.py:769: in _fs_copy_file
r = session.post(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/requests/sessions.py:637: in post
return self.request("POST", url, data=data, json=json, **kwargs)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/requests/sessions.py:589: in request
resp = self.send(prep, **send_kwargs)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/requests/sessions.py:710: in send
r = dispatch_hook("response", hooks, r, **kwargs)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/requests/hooks.py:30: in dispatch_hook
_hook_data = hook(hook_data, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
response = <Response [500]>, args = ()
kwargs = {'cert': None, 'proxies': OrderedDict(), 'stream': False, 'timeout': None, ...}
r_content = {'description': 'Copying ansfs://default_execution_scripts/mapdl-v241-exec_mapdl.py failed', 'title': 'Copy failed'}
reason = 'Copy failed'
description = 'Copying ansfs://default_execution_scripts/mapdl-v241-exec_mapdl.py failed'
error_msg = '500 Server Error: Copy failed for: POST https://localhost:8443/hps/fs/api/v1/default_execution_scripts/mapdl-v241-exec_mapdl.py:copy?fields=all\nCopying ansfs://default_execution_scripts/mapdl-v241-exec_mapdl.py failed'
def raise_for_status(response, *args, **kwargs):
"""Automatically checks HTTP errors.
This method mimics the requests.Response.raise_for_status() method.
"""
if 400 <= response.status_code < 600:
r_content = {}
try:
r_content = response.json()
except ValueError:
pass
reason = r_content.get("title", None) # jms api
if not reason:
reason = r_content.get("error", None) # auth api
if not reason:
reason = response.reason
description = r_content.get("description", None) # jms api
if not description:
description = r_content.get("error_description", None) # auth api
if 400 <= response.status_code < 500:
error_msg = "%s Client Error: %s for: %s %s" % (
response.status_code,
reason,
response.request.method,
response.url,
)
if description:
error_msg += f"\n{description}"
raise ClientError(error_msg, reason=reason, description=description, response=response)
elif 500 <= response.status_code < 600:
error_msg = "%s Server Error: %s for: %s %s" % (
response.status_code,
reason,
response.request.method,
response.url,
)
if description:
error_msg += f"\n{description}"
> raise APIError(error_msg, reason=reason, description=description, response=response)
E ansys.hps.client.exceptions.APIError: 500 Server Error: Copy failed for: POST https://localhost:8443/hps/fs/api/v1/default_execution_scripts/mapdl-v241-exec_mapdl.py:copy?fields=all
E Copying ansfs://default_execution_scripts/mapdl-v241-exec_mapdl.py failed
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/ansys/hps/client/exceptions.py:105: APIError
Check failure on line 114 in tests/jms/test_task_definition_templates.py
github-actions / Test Report ubuntu-latest:3.10
test_task_definition_templates.test_template_integration
assert 0 > 0
+ where 0 = len([])
Raw output
client = <ansys.hps.client.client.Client object at 0x7fbc2f830a90>
def test_template_integration(client):
jms_api = JmsApi(client)
# Test get queries
templates = jms_api.get_task_definition_templates()
> assert len(templates) > 0
E assert 0 > 0
E + where 0 = len([])
tests/jms/test_task_definition_templates.py:114: AssertionError
Check failure on line 193 in tests/test_examples.py
github-actions / Test Report ubuntu-latest:3.10
test_examples.test_fluent_2d_heat_exchanger_with_exec_script
ansys.hps.client.exceptions.APIError: 500 Server Error: Copy failed for: POST https://localhost:8443/hps/fs/api/v1/default_execution_scripts/fluent-v241-exec_fluent.py:copy?fields=all
Copying ansfs://default_execution_scripts/fluent-v241-exec_fluent.py failed
Raw output
client = <ansys.hps.client.client.Client object at 0x7fbc2f830a90>
def test_fluent_2d_heat_exchanger_with_exec_script(client):
from examples.fluent_2d_heat_exchanger.project_setup import create_project
> project = create_project(
client, name="Fluent Test", version=ansys_version, use_exec_script=True
)
tests/test_examples.py:193:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
examples/fluent_2d_heat_exchanger/project_setup.py:121: in create_project
exec_script_file = project_api.copy_default_execution_script(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/ansys/hps/client/jms/api/project_api.py:531: in copy_default_execution_script
checksum = _fs_copy_file(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/ansys/hps/client/jms/api/project_api.py:769: in _fs_copy_file
r = session.post(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/requests/sessions.py:637: in post
return self.request("POST", url, data=data, json=json, **kwargs)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/requests/sessions.py:589: in request
resp = self.send(prep, **send_kwargs)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/requests/sessions.py:710: in send
r = dispatch_hook("response", hooks, r, **kwargs)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/requests/hooks.py:30: in dispatch_hook
_hook_data = hook(hook_data, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
response = <Response [500]>, args = ()
kwargs = {'cert': None, 'proxies': OrderedDict(), 'stream': False, 'timeout': None, ...}
r_content = {'description': 'Copying ansfs://default_execution_scripts/fluent-v241-exec_fluent.py failed', 'title': 'Copy failed'}
reason = 'Copy failed'
description = 'Copying ansfs://default_execution_scripts/fluent-v241-exec_fluent.py failed'
error_msg = '500 Server Error: Copy failed for: POST https://localhost:8443/hps/fs/api/v1/default_execution_scripts/fluent-v241-exec_fluent.py:copy?fields=all\nCopying ansfs://default_execution_scripts/fluent-v241-exec_fluent.py failed'
def raise_for_status(response, *args, **kwargs):
"""Automatically checks HTTP errors.
This method mimics the requests.Response.raise_for_status() method.
"""
if 400 <= response.status_code < 600:
r_content = {}
try:
r_content = response.json()
except ValueError:
pass
reason = r_content.get("title", None) # jms api
if not reason:
reason = r_content.get("error", None) # auth api
if not reason:
reason = response.reason
description = r_content.get("description", None) # jms api
if not description:
description = r_content.get("error_description", None) # auth api
if 400 <= response.status_code < 500:
error_msg = "%s Client Error: %s for: %s %s" % (
response.status_code,
reason,
response.request.method,
response.url,
)
if description:
error_msg += f"\n{description}"
raise ClientError(error_msg, reason=reason, description=description, response=response)
elif 500 <= response.status_code < 600:
error_msg = "%s Server Error: %s for: %s %s" % (
response.status_code,
reason,
response.request.method,
response.url,
)
if description:
error_msg += f"\n{description}"
> raise APIError(error_msg, reason=reason, description=description, response=response)
E ansys.hps.client.exceptions.APIError: 500 Server Error: Copy failed for: POST https://localhost:8443/hps/fs/api/v1/default_execution_scripts/fluent-v241-exec_fluent.py:copy?fields=all
E Copying ansfs://default_execution_scripts/fluent-v241-exec_fluent.py failed
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/ansys/hps/client/exceptions.py:105: APIError
Check failure on line 244 in tests/test_examples.py
github-actions / Test Report ubuntu-latest:3.10
test_examples.test_lsdyna_cylinder_plate_with_exec_script
ansys.hps.client.exceptions.APIError: 500 Server Error: Copy failed for: POST https://localhost:8443/hps/fs/api/v1/default_execution_scripts/lsdyna-v241-exec_lsdyna.py:copy?fields=all
Copying ansfs://default_execution_scripts/lsdyna-v241-exec_lsdyna.py failed
Raw output
client = <ansys.hps.client.client.Client object at 0x7fbc2f830a90>
def test_lsdyna_cylinder_plate_with_exec_script(client):
from examples.lsdyna_cylinder_plate.lsdyna_job import submit_job
> app_job = submit_job(use_exec_script=True)
tests/test_examples.py:244:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
examples/lsdyna_cylinder_plate/lsdyna_job.py:230: in submit_job
exec_script_file = project_api.copy_default_execution_script(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/ansys/hps/client/jms/api/project_api.py:531: in copy_default_execution_script
checksum = _fs_copy_file(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/ansys/hps/client/jms/api/project_api.py:769: in _fs_copy_file
r = session.post(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/requests/sessions.py:637: in post
return self.request("POST", url, data=data, json=json, **kwargs)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/requests/sessions.py:589: in request
resp = self.send(prep, **send_kwargs)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/requests/sessions.py:710: in send
r = dispatch_hook("response", hooks, r, **kwargs)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/requests/hooks.py:30: in dispatch_hook
_hook_data = hook(hook_data, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
response = <Response [500]>, args = ()
kwargs = {'cert': None, 'proxies': OrderedDict(), 'stream': False, 'timeout': None, ...}
r_content = {'description': 'Copying ansfs://default_execution_scripts/lsdyna-v241-exec_lsdyna.py failed', 'title': 'Copy failed'}
reason = 'Copy failed'
description = 'Copying ansfs://default_execution_scripts/lsdyna-v241-exec_lsdyna.py failed'
error_msg = '500 Server Error: Copy failed for: POST https://localhost:8443/hps/fs/api/v1/default_execution_scripts/lsdyna-v241-exec_lsdyna.py:copy?fields=all\nCopying ansfs://default_execution_scripts/lsdyna-v241-exec_lsdyna.py failed'
def raise_for_status(response, *args, **kwargs):
"""Automatically checks HTTP errors.
This method mimics the requests.Response.raise_for_status() method.
"""
if 400 <= response.status_code < 600:
r_content = {}
try:
r_content = response.json()
except ValueError:
pass
reason = r_content.get("title", None) # jms api
if not reason:
reason = r_content.get("error", None) # auth api
if not reason:
reason = response.reason
description = r_content.get("description", None) # jms api
if not description:
description = r_content.get("error_description", None) # auth api
if 400 <= response.status_code < 500:
error_msg = "%s Client Error: %s for: %s %s" % (
response.status_code,
reason,
response.request.method,
response.url,
)
if description:
error_msg += f"\n{description}"
raise ClientError(error_msg, reason=reason, description=description, response=response)
elif 500 <= response.status_code < 600:
error_msg = "%s Server Error: %s for: %s %s" % (
response.status_code,
reason,
response.request.method,
response.url,
)
if description:
error_msg += f"\n{description}"
> raise APIError(error_msg, reason=reason, description=description, response=response)
E ansys.hps.client.exceptions.APIError: 500 Server Error: Copy failed for: POST https://localhost:8443/hps/fs/api/v1/default_execution_scripts/lsdyna-v241-exec_lsdyna.py:copy?fields=all
E Copying ansfs://default_execution_scripts/lsdyna-v241-exec_lsdyna.py failed
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/ansys/hps/client/exceptions.py:105: APIError