nassauwinter / zephyr-python-api

Python wrappers for Zephyr Scale API
Apache License 2.0
1 stars 4 forks source link

Internal Server Error - 500 /// API not Working #28

Open jay-2597 opened 4 months ago

jay-2597 commented 4 months ago

@nassauwinter @crapitea ,

Facing issue HTTP Error - 500 when using the api function - create_step_attachment in TestCaseEndpoints class. API endpoint --- /testcase/{testCaseKey}/step/{stepIndex}/attachments Seems The post api is not working. Already Verified that get API for same is working fine.

Traceback (most recent call last): File "c:\work\work1\file1.py", line 107, in test_object.step_attachments(index=0, files=file_path) File "c:\work\work1\file2.py", line 99, in step_attachments self.zapi.test_cases.create_step_attachment(test_case_key=self.test_id, step_index=index, file_path=files) File "C:\Users\pateljay\AppData\Local\Programs\Python\Python312\Lib\site-packages\zephyr\scale\server\endpoints\endpoints.py", line 54, in create_step_attachment return self.session.post(Paths.CASE_STP_ATTACH.format(test_case_key, step_index), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\pateljay\AppData\Local\Programs\Python\Python312\Lib\site-packages\zephyr\scale\zephyr_session.py", line 76, in post return self._request("post", endpoint, json=json, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\pateljay\AppData\Local\Programs\Python\Python312\Lib\site-packages\zephyr\scale\zephyr_session.py", line 68, in _request raise HTTPError(f"Error {response.status_code}. Response: {response.content}") requests.exceptions.HTTPError: Error 500. Response: b''

nassauwinter commented 4 months ago

Hi.

  1. Could you please confirm you are using Zephyr Scale Server?
  2. What do you provide to file path as files here:
    self.zapi.test_cases.create_step_attachment(test_case_key=self.test_id, step_index=index, file_path=files)
jay-2597 commented 4 months ago
  1. Yes using Zephyr Scale Server
  2. for files i am currently providing a path of a file.