mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-02-24 00:59:35 -06:00
Chore(mypy): Annotate None returns for typing improvements (#11213)
This commit is contained in:
committed by
GitHub
parent
a9c0b06e28
commit
3b5ffbf9fa
@@ -78,7 +78,7 @@ class TestApiWorkflows(DirectoriesMixin, APITestCase):
|
||||
self.workflow.actions.add(self.action)
|
||||
self.workflow.save()
|
||||
|
||||
def test_api_get_workflow(self):
|
||||
def test_api_get_workflow(self) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- API request to get all workflows
|
||||
@@ -99,7 +99,7 @@ class TestApiWorkflows(DirectoriesMixin, APITestCase):
|
||||
self.action.assign_correspondent.pk,
|
||||
)
|
||||
|
||||
def test_api_create_workflow(self):
|
||||
def test_api_create_workflow(self) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- API request to create a workflow, trigger and action separately
|
||||
@@ -160,7 +160,7 @@ class TestApiWorkflows(DirectoriesMixin, APITestCase):
|
||||
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
|
||||
self.assertEqual(Workflow.objects.count(), 2)
|
||||
|
||||
def test_api_create_workflow_nested(self):
|
||||
def test_api_create_workflow_nested(self) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- API request to create a workflow with nested trigger and action
|
||||
@@ -280,7 +280,7 @@ class TestApiWorkflows(DirectoriesMixin, APITestCase):
|
||||
json.dumps(["AND", [[self.cf1.id, "exact", "value"]]]),
|
||||
)
|
||||
|
||||
def test_api_create_invalid_workflow_trigger(self):
|
||||
def test_api_create_invalid_workflow_trigger(self) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- API request to create a workflow trigger
|
||||
@@ -316,7 +316,7 @@ class TestApiWorkflows(DirectoriesMixin, APITestCase):
|
||||
|
||||
self.assertEqual(WorkflowTrigger.objects.count(), 1)
|
||||
|
||||
def test_api_create_invalid_assign_title(self):
|
||||
def test_api_create_invalid_assign_title(self) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- API request to create a workflow
|
||||
@@ -355,7 +355,7 @@ class TestApiWorkflows(DirectoriesMixin, APITestCase):
|
||||
|
||||
self.assertEqual(Workflow.objects.count(), 1)
|
||||
|
||||
def test_api_create_workflow_trigger_action_empty_fields(self):
|
||||
def test_api_create_workflow_trigger_action_empty_fields(self) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- API request to create a workflow trigger and action
|
||||
@@ -412,7 +412,7 @@ class TestApiWorkflows(DirectoriesMixin, APITestCase):
|
||||
self.assertEqual(trigger2.filter_path, "*/test/*")
|
||||
self.assertIsNone(trigger2.filter_filename)
|
||||
|
||||
def test_api_update_workflow_nested_triggers_actions(self):
|
||||
def test_api_update_workflow_nested_triggers_actions(self) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- Existing workflow with trigger and action
|
||||
@@ -498,7 +498,7 @@ class TestApiWorkflows(DirectoriesMixin, APITestCase):
|
||||
)
|
||||
self.assertEqual(workflow.actions.first().assign_title, "Action New Title")
|
||||
|
||||
def test_api_update_workflow_no_trigger_actions(self):
|
||||
def test_api_update_workflow_no_trigger_actions(self) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- Existing workflow
|
||||
@@ -542,7 +542,7 @@ class TestApiWorkflows(DirectoriesMixin, APITestCase):
|
||||
self.assertEqual(workflow.triggers.count(), 1)
|
||||
self.assertEqual(workflow.actions.count(), 0)
|
||||
|
||||
def test_api_auto_remove_orphaned_triggers_actions(self):
|
||||
def test_api_auto_remove_orphaned_triggers_actions(self) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- Existing trigger and action
|
||||
@@ -582,7 +582,7 @@ class TestApiWorkflows(DirectoriesMixin, APITestCase):
|
||||
self.assertEqual(WorkflowAction.objects.all().count(), 1)
|
||||
self.assertNotEqual(workflow.actions.first().id, self.action.id)
|
||||
|
||||
def test_email_action_validation(self):
|
||||
def test_email_action_validation(self) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- API request to create a workflow with an email action
|
||||
@@ -675,7 +675,7 @@ class TestApiWorkflows(DirectoriesMixin, APITestCase):
|
||||
)
|
||||
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
|
||||
|
||||
def test_webhook_action_validation(self):
|
||||
def test_webhook_action_validation(self) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- API request to create a workflow with a notification action
|
||||
@@ -737,7 +737,7 @@ class TestApiWorkflows(DirectoriesMixin, APITestCase):
|
||||
)
|
||||
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
|
||||
|
||||
def test_webhook_action_url_validation(self):
|
||||
def test_webhook_action_url_validation(self) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- API request to create a workflow with a notification action
|
||||
@@ -779,7 +779,7 @@ class TestApiWorkflows(DirectoriesMixin, APITestCase):
|
||||
)
|
||||
self.assertEqual(response.status_code, expected_resp_code)
|
||||
|
||||
def test_patch_trigger_cannot_change_id(self):
|
||||
def test_patch_trigger_cannot_change_id(self) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- An existing workflow trigger
|
||||
|
||||
Reference in New Issue
Block a user