Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jpbruinsslot committed Jan 8, 2025
1 parent 31db13b commit 3e9cac6
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions mula/tests/integration/test_boefje_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
from types import SimpleNamespace
from unittest import mock

from scheduler import clients, config, models, schedulers, storage
from scheduler.storage import stores
from structlog.testing import capture_logs

from scheduler import clients, config, models, schedulers, storage
from scheduler.storage import stores
from tests.factories import (
BoefjeFactory,
BoefjeMetaFactory,
Expand Down Expand Up @@ -1019,7 +1019,7 @@ def test_process_mutations(self):
ooi = OOIFactory(scan_profile=ScanProfileFactory(level=0))
boefje = PluginFactory(scan_level=0, consumes=[ooi.object_type])
mutation = models.ScanProfileMutation(
operation="create", primary_key=ooi.primary_key, value=ooi, organisation=self.organisation.id
operation="create", primary_key=ooi.primary_key, value=ooi, client_id=self.organisation.id
).model_dump_json()

# Mocks
Expand All @@ -1044,7 +1044,7 @@ def test_process_mutations_value_empty(self):
"""When the value of a mutation is empty it should not push any tasks"""
# Arrange
mutation = models.ScanProfileMutation(
operation="create", primary_key="123", value=None, organisation=self.organisation.id
operation="create", primary_key="123", value=None, client_id=self.organisation.id
).model_dump_json()

# Act
Expand All @@ -1059,7 +1059,7 @@ def test_process_mutations_no_boefjes_found(self):
scan_profile = ScanProfileFactory(level=0)
ooi = OOIFactory(scan_profile=scan_profile)
mutation = models.ScanProfileMutation(
operation="create", primary_key=ooi.primary_key, value=ooi, organisation=self.organisation.id
operation="create", primary_key=ooi.primary_key, value=ooi, client_id=self.organisation.id
).model_dump_json()

# Mocks
Expand All @@ -1078,7 +1078,7 @@ def test_process_mutations_not_allowed_to_run(self):
ooi = OOIFactory(scan_profile=scan_profile)
boefje = PluginFactory(scan_level=0, consumes=[ooi.object_type])
mutation = models.ScanProfileMutation(
operation="create", primary_key=ooi.primary_key, value=ooi, organisation=self.organisation.id
operation="create", primary_key=ooi.primary_key, value=ooi, client_id=self.organisation.id
).model_dump_json()

# Mocks
Expand All @@ -1098,7 +1098,7 @@ def test_process_mutations_still_running(self):
ooi = OOIFactory(scan_profile=scan_profile)
boefje = PluginFactory(scan_level=0, consumes=[ooi.object_type])
mutation = models.ScanProfileMutation(
operation="create", primary_key=ooi.primary_key, value=ooi, organisation=self.organisation.id
operation="create", primary_key=ooi.primary_key, value=ooi, client_id=self.organisation.id
).model_dump_json()

# Mocks
Expand All @@ -1119,10 +1119,10 @@ def test_process_mutations_item_on_queue(self):
boefje = PluginFactory(scan_level=0, consumes=[ooi.object_type])

mutation1 = models.ScanProfileMutation(
operation="create", primary_key=ooi.primary_key, value=ooi, organisation=self.organisation.id
operation="create", primary_key=ooi.primary_key, value=ooi, client_id=self.organisation.id
).model_dump_json()
mutation2 = models.ScanProfileMutation(
operation="create", primary_key=ooi.primary_key, value=ooi, organisation=self.organisation.id
operation="create", primary_key=ooi.primary_key, value=ooi, client_id=self.organisation.id
).model_dump_json()

# Mocks
Expand Down Expand Up @@ -1154,7 +1154,7 @@ def test_process_mutations_delete(self):
operation=models.MutationOperationType.DELETE,
primary_key=ooi.primary_key,
value=ooi,
organisation=self.organisation.id,
client_id=self.organisation.id,
).model_dump_json()

# Mocks
Expand All @@ -1179,7 +1179,7 @@ def test_process_mutations_delete_on_queue(self):
operation=models.MutationOperationType.CREATE,
primary_key=ooi.primary_key,
value=ooi,
organisation=self.organisation.id,
client_id=self.organisation.id,
).model_dump_json()

# Mocks
Expand All @@ -1200,7 +1200,7 @@ def test_process_mutations_delete_on_queue(self):
operation=models.MutationOperationType.DELETE,
primary_key=ooi.primary_key,
value=ooi,
organisation=self.organisation.id,
client_id=self.organisation.id,
).model_dump_json()

# Act
Expand Down Expand Up @@ -1230,7 +1230,7 @@ def test_process_mutations_op_create_run_on_create(self):
operation=models.MutationOperationType.CREATE,
primary_key=ooi.primary_key,
value=ooi,
organisation=self.organisation.id,
client_id=self.organisation.id,
).model_dump_json()

# Mocks
Expand Down Expand Up @@ -1270,7 +1270,7 @@ def test_process_mutations_op_create_run_on_create_update(self):
operation=models.MutationOperationType.CREATE,
primary_key=ooi.primary_key,
value=ooi,
organisation=self.organisation.id,
client_id=self.organisation.id,
).model_dump_json()

# Mocks
Expand Down Expand Up @@ -1310,7 +1310,7 @@ def test_process_mutations_op_create_run_on_update(self):
operation=models.MutationOperationType.CREATE,
primary_key=ooi.primary_key,
value=ooi,
organisation=self.organisation.id,
client_id=self.organisation.id,
).model_dump_json()

# Mocks
Expand All @@ -1337,7 +1337,7 @@ def test_process_mutations_op_create_run_on_none(self):
operation=models.MutationOperationType.CREATE,
primary_key=ooi.primary_key,
value=ooi,
organisation=self.organisation.id,
client_id=self.organisation.id,
).model_dump_json()

# Mocks
Expand Down Expand Up @@ -1378,7 +1378,7 @@ def test_process_mutations_op_update_run_on_create(self):
operation=models.MutationOperationType.UPDATE,
primary_key=ooi.primary_key,
value=ooi,
organisation=self.organisation.id,
client_id=self.organisation.id,
).model_dump_json()

# Mocks
Expand All @@ -1405,7 +1405,7 @@ def test_process_mutations_op_update_run_on_create_update(self):
operation=models.MutationOperationType.UPDATE,
primary_key=ooi.primary_key,
value=ooi,
organisation=self.organisation.id,
client_id=self.organisation.id,
).model_dump_json()

# Mocks
Expand Down Expand Up @@ -1445,7 +1445,7 @@ def test_process_mutations_op_update_run_on_update(self):
operation=models.MutationOperationType.UPDATE,
primary_key=ooi.primary_key,
value=ooi,
organisation=self.organisation.id,
client_id=self.organisation.id,
).model_dump_json()

# Mocks
Expand Down Expand Up @@ -1485,7 +1485,7 @@ def test_process_mutations_op_update_run_on_none(self):
operation=models.MutationOperationType.UPDATE,
primary_key=ooi.primary_key,
value=ooi,
organisation=self.organisation.id,
client_id=self.organisation.id,
).model_dump_json()

# Mocks
Expand Down

0 comments on commit 3e9cac6

Please sign in to comment.