1
0
Fork 0
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:
kakwa 2015-05-12 11:34:28 +02:00
parent 17b8aa6406
commit 804e2b7202
3 changed files with 25 additions and 3 deletions

View file

@ -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')