Skip to content

Commit 9a07d9e

Browse files
Resolve Failing Tests: Correction to adanced_usage=True (#1074)
* Revert change: `pprint` to `print` ... `pprint` is valid and the correct thing for this example (pretty-print-usage) Signed-off-by: Martyn Bristow <martyn.bristow@gmail.com> * Resolution of `advanced_mode=True` breaks existing functionality by returning raw response Return None on 404. Preserve Existing Functionality Signed-off-by: Martyn Bristow <martyn.bristow@gmail.com> Signed-off-by: Martyn Bristow <martyn.bristow@gmail.com>
1 parent 46a97cd commit 9a07d9e

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

atlassian/bitbucket/cloud/repositories/pipelines.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,11 +243,13 @@ def log(self, start=None, end=None):
243243
response = None
244244
try:
245245
response = self.get("log", headers=headers, advanced_mode=True)
246+
response.raise_for_status()
246247
except HTTPError as e:
247248
# A 404 indicates that no log is present.
248249
if not e.response.status_code == 404:
249250
# Rethrow the exception
250251
raise
252+
return None
251253

252254
if response is None:
253255
if start is None:

tests/test_bitbucket_cloud_oo.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ def test_get_pipeline_step(self):
9292
assert result["uuid"] == "{PipelineStep1Uuid}", "Result of [get_pipeline_step(...)]"
9393

9494
def test_get_pipeline_step_log_1(self):
95+
"""Test Not Found"""
9596
result = BITBUCKET.get_pipeline_step_log(
9697
"TestWorkspace1", "testrepository1", "{PipelineUuid}", "{PipelineStep1Uuid}"
9798
)

0 commit comments

Comments
 (0)