mirror of
https://github.com/kakwa/ldapcherry
synced 2025-07-03 11:57:41 +02:00
adding an exception for failures to open role file
This commit is contained in:
parent
17b8aa6406
commit
804e2b7202
3 changed files with 25 additions and 3 deletions
|
@ -7,7 +7,7 @@ from __future__ import unicode_literals
|
|||
import pytest
|
||||
import sys
|
||||
from ldapcherry.roles import Roles
|
||||
from ldapcherry.exceptions import DumplicateRoleKey, MissingKey, DumplicateRoleContent
|
||||
from ldapcherry.exceptions import DumplicateRoleKey, MissingKey, DumplicateRoleContent, MissingRolesFile
|
||||
from ldapcherry.pyyamlwrapper import DumplicatedKey, RelationError
|
||||
|
||||
|
||||
|
@ -34,6 +34,15 @@ class TestError(object):
|
|||
else:
|
||||
raise AssertionError("expected an exception")
|
||||
|
||||
|
||||
def testNoFile(self):
|
||||
try:
|
||||
inv = Roles('./tests/cfg/dontexist')
|
||||
except MissingRolesFile:
|
||||
return
|
||||
else:
|
||||
raise AssertionError("expected an exception")
|
||||
|
||||
def testRoleContentDuplication(self):
|
||||
try:
|
||||
inv = Roles('./tests/cfg/roles_content_dump.yml')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue