Skip to content

Commit ba52edb

Browse files
committed
✅ Add test for tokenauth setup config to fix coverage
1 parent 59fe617 commit ba52edb

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
tokenauth_config_enable: true
2+
tokenauth:
3+
items: []

src/objects/setup_configuration/tests/test_token_auth_config.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,15 @@ def test_invalid_empty_identifier(self):
421421
self.assertTrue("String should match pattern" in str(command_error.exception))
422422
self.assertEqual(TokenAuth.objects.count(), 0)
423423

424+
def test_valid_without_configured_tokens(self):
425+
execute_single_step(
426+
TokenAuthConfigurationStep,
427+
yaml_source=str(DIR_FILES / "no_tokens.yaml"),
428+
)
429+
430+
tokens = TokenAuth.objects.all()
431+
self.assertEqual(tokens.count(), 0)
432+
424433

425434
class TokenAuthConfigurationStepWithPermissionsTests(TokenTestCase):
426435
def test_valid_setup_default_without_permissions(self):

0 commit comments

Comments
 (0)