Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions rossum_api/domain_logic/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ class Resource(Enum):

Annotation = "annotations"
AnnotationProcessingDuration = "annotations/processing_duration"
AutomationStats = "automation_insights"
AutomationProjections = "automation_projections"
AutomationTarget = "automation_targets"
AutomationStats = "automation/insights"
AutomationProjections = "automation/projections"
AutomationTarget = "automation/targets"
Auth = "auth"
Connector = "connectors"
Document = "documents"
Expand Down
6 changes: 3 additions & 3 deletions rossum_api/domain_logic/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ def build_resource_processing_duration_url(resource: Resource, id_: int) -> str:


def build_automation_insights_url(queue_id: int) -> str:
return f"queues/{queue_id}/automation_setup_current_stats"
return f"queues/{queue_id}/automation/insights"


def build_automation_projections_url(queue_id: int) -> str:
return f"queues/{queue_id}/automation_setup_projections"
return f"queues/{queue_id}/automation/projections"


def build_queue_automation_targets_url(queue_id: int) -> str:
return f"queues/{queue_id}/automation_targets"
return f"queues/{queue_id}/automation/targets"
22 changes: 9 additions & 13 deletions tests/elis_api_client/test_automation.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,7 @@ async def test_retrieve_automation_insights(self, elis_client, dummy_current_sta
assert result == dacite.from_dict(
AutomationStats, dummy_current_stats, config=DACITE_CONFIG
)
http_client.request_json.assert_called_with(
"GET", "queues/123/automation_setup_current_stats"
)
http_client.request_json.assert_called_with("GET", "queues/123/automation/insights")

async def test_retrieve_automation_projections(self, elis_client, dummy_projections):
client, http_client = elis_client
Expand All @@ -135,7 +133,7 @@ async def test_retrieve_automation_projections(self, elis_client, dummy_projecti
)
http_client.request_json.assert_called_with(
"POST",
"queues/123/automation_setup_projections",
"queues/123/automation/projections",
json={"fields": [{"schema_id": "amount_total", "error_rate_limit": 0.05}]},
)

Expand All @@ -153,7 +151,7 @@ async def test_retrieve_projections_with_exclude_blockers(

http_client.request_json.assert_called_with(
"POST",
"queues/123/automation_setup_projections",
"queues/123/automation/projections",
json={"fields": [{"schema_id": "amount_total", "error_rate_limit": 0.05}]},
params={"exclude_blockers": "error_message,extension"},
)
Expand All @@ -167,7 +165,7 @@ async def test_list_automation_targets(self, elis_client, dummy_automation_targe
assert result == [
dacite.from_dict(AutomationTarget, dummy_automation_target, config=DACITE_CONFIG)
]
http_client.request_json.assert_called_with("GET", "queues/456/automation_targets")
http_client.request_json.assert_called_with("GET", "queues/456/automation/targets")

async def test_create_new_automation_target(self, elis_client):
client, http_client = elis_client
Expand All @@ -190,7 +188,7 @@ async def test_create_new_automation_target(self, elis_client):
assert result is None
http_client.request.assert_called_with(
"POST",
"queues/789/automation_targets",
"queues/789/automation/targets",
json={
"automation_rate_target": 0.8,
"error_rate_target": 0.05,
Expand Down Expand Up @@ -232,9 +230,7 @@ def test_retrieve_automation_insights(self, elis_client_sync, dummy_current_stat
assert result == dacite.from_dict(
AutomationStats, dummy_current_stats, config=DACITE_CONFIG
)
http_client.request_json.assert_called_with(
"GET", "queues/123/automation_setup_current_stats"
)
http_client.request_json.assert_called_with("GET", "queues/123/automation/insights")

def test_retrieve_automation_projections(self, elis_client_sync, dummy_projections):
client, http_client = elis_client_sync
Expand All @@ -248,7 +244,7 @@ def test_retrieve_automation_projections(self, elis_client_sync, dummy_projectio
)
http_client.request_json.assert_called_with(
"POST",
"queues/123/automation_setup_projections",
"queues/123/automation/projections",
json={"fields": [{"schema_id": "amount_total", "error_rate_limit": 0.05}]},
)

Expand All @@ -261,7 +257,7 @@ def test_list_automation_targets(self, elis_client_sync, dummy_automation_target
assert result == [
dacite.from_dict(AutomationTarget, dummy_automation_target, config=DACITE_CONFIG)
]
http_client.request_json.assert_called_with("GET", "queues/456/automation_targets")
http_client.request_json.assert_called_with("GET", "queues/456/automation/targets")

def test_create_new_automation_target(self, elis_client_sync):
client, http_client = elis_client_sync
Expand All @@ -284,7 +280,7 @@ def test_create_new_automation_target(self, elis_client_sync):
assert result is None
http_client.request.assert_called_with(
"POST",
"queues/789/automation_targets",
"queues/789/automation/targets",
json={
"automation_rate_target": 0.8,
"error_rate_target": 0.05,
Expand Down
Loading