예제 #1
0
def test_validate_group():
    # We import grp here so that this module can be imported on Windows.
    import grp
    group_name_which_exists = grp.getgrall()[0].gr_name
    UserManagement.validate_group(group_name_which_exists)

    with pytest.raises(ValidationError):
        UserManagement.validate_group('group-should-not-exist')
예제 #2
0
파일: test_util.py 프로젝트: dcos/dcos
def test_validate_group():
    # We import grp here so that this module can be imported on Windows.
    import grp
    group_name_which_exists = grp.getgrall()[0].gr_name
    UserManagement.validate_group(group_name_which_exists)

    with pytest.raises(ValidationError):
        UserManagement.validate_group('group-should-not-exist')
def test_validate_group():
    # assuming linux distributions have `root` group.
    UserManagement.validate_group('root')

    with pytest.raises(ValidationError):
        UserManagement.validate_group('group-should-not-exist')
 def bad(name):
     with pytest.raises(ValidationError):
         UserManagement.validate_username(name)
 def good(name):
     UserManagement.validate_username(name)
예제 #6
0
파일: test_util.py 프로젝트: malnick/dcos
def test_validate_group():
    # assuming linux distributions have `root` group.
    UserManagement.validate_group('root')

    with pytest.raises(ValidationError):
        UserManagement.validate_group('group-should-not-exist')
예제 #7
0
파일: test_util.py 프로젝트: malnick/dcos
 def bad(name):
     with pytest.raises(ValidationError):
         UserManagement.validate_username(name)
예제 #8
0
파일: test_util.py 프로젝트: malnick/dcos
 def good(name):
     UserManagement.validate_username(name)