style: format test file with black
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
This commit is contained in:
@@ -26,6 +26,7 @@ class TestFileStatusBugFixes:
|
|||||||
This simulates the bug where a file shows "Processing" even though
|
This simulates the bug where a file shows "Processing" even though
|
||||||
all steps have completed successfully.
|
all steps have completed successfully.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
class MockLog:
|
class MockLog:
|
||||||
def __init__(self, step_name, status, timestamp):
|
def __init__(self, step_name, status, timestamp):
|
||||||
self.step_name = step_name
|
self.step_name = step_name
|
||||||
@@ -56,6 +57,7 @@ class TestFileStatusBugFixes:
|
|||||||
Test that status correctly shows "processing" when there are
|
Test that status correctly shows "processing" when there are
|
||||||
actually in-progress tasks (based on latest status).
|
actually in-progress tasks (based on latest status).
|
||||||
"""
|
"""
|
||||||
|
|
||||||
class MockLog:
|
class MockLog:
|
||||||
def __init__(self, step_name, status, timestamp):
|
def __init__(self, step_name, status, timestamp):
|
||||||
self.step_name = step_name
|
self.step_name = step_name
|
||||||
@@ -81,6 +83,7 @@ class TestFileStatusBugFixes:
|
|||||||
"""
|
"""
|
||||||
Test that status shows "failed" when the latest status for any step is failure.
|
Test that status shows "failed" when the latest status for any step is failure.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
class MockLog:
|
class MockLog:
|
||||||
def __init__(self, step_name, status, timestamp):
|
def __init__(self, step_name, status, timestamp):
|
||||||
self.step_name = step_name
|
self.step_name = step_name
|
||||||
@@ -200,14 +203,14 @@ class TestMetricsCountingBugFixes:
|
|||||||
|
|
||||||
# Add latest status (all success) - most recent
|
# Add latest status (all success) - most recent
|
||||||
for i, service in enumerate(services):
|
for i, service in enumerate(services):
|
||||||
logs.append(MockLog(f"upload_to_{service}", "success", now - timedelta(minutes=i*2)))
|
logs.append(MockLog(f"upload_to_{service}", "success", now - timedelta(minutes=i * 2)))
|
||||||
logs.append(MockLog(f"queue_{service}", "success", now - timedelta(minutes=i*2+1)))
|
logs.append(MockLog(f"queue_{service}", "success", now - timedelta(minutes=i * 2 + 1)))
|
||||||
|
|
||||||
# Add some older in_progress logs
|
# Add some older in_progress logs
|
||||||
base_offset = len(services) * 2
|
base_offset = len(services) * 2
|
||||||
for i, service in enumerate(services):
|
for i, service in enumerate(services):
|
||||||
logs.append(MockLog(f"upload_to_{service}", "in_progress", now - timedelta(minutes=base_offset+i*2)))
|
logs.append(MockLog(f"upload_to_{service}", "in_progress", now - timedelta(minutes=base_offset + i * 2)))
|
||||||
logs.append(MockLog(f"queue_{service}", "in_progress", now - timedelta(minutes=base_offset+i*2+1)))
|
logs.append(MockLog(f"queue_{service}", "in_progress", now - timedelta(minutes=base_offset + i * 2 + 1)))
|
||||||
|
|
||||||
summary = _compute_step_summary(logs)
|
summary = _compute_step_summary(logs)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user