Skip to content

Commit

Permalink
[#467] update invalid connection test
Browse files Browse the repository at this point in the history
  • Loading branch information
SonnyBA committed Dec 11, 2024
1 parent 9615bcf commit 045088e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ objects_api_objecttypes_connection:
nlx: http://some-outway-adress.local:8080/
user_id: objects-api
user_representation: Objects API
timeout: 60
timeout: foobar
10 changes: 6 additions & 4 deletions src/objects/core/tests/test_objecttype_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from django.test import TestCase

from django_setup_configuration.exceptions import PrerequisiteFailed
from django_setup_configuration.test_utils import execute_single_step
from zgw_consumers.constants import APITypes, AuthTypes
from zgw_consumers.models import Service
Expand Down Expand Up @@ -80,12 +81,13 @@ def test_update_connection(self):
self.assertEqual(service.user_representation, "Objects API")
self.assertEqual(service.timeout, 60)

def test_invalid_identifier(self):
def test_invalid_connection(self):
test_file_path = str(TEST_FILES / "objecttypes_connection_invalid.yaml")

execute_single_step(
ObjectTypesConnectionConfigurationStep, yaml_source=test_file_path
)
with self.assertRaises(PrerequisiteFailed):
execute_single_step(
ObjectTypesConnectionConfigurationStep, yaml_source=test_file_path
)

self.assertEqual(Service.objects.count(), 0)

Expand Down

0 comments on commit 045088e

Please sign in to comment.