예제 #1
0
파일: ent_test.py 프로젝트: vtapia/sssd
def test_assert_each_passwd_with_name(users_and_groups):
    ent.assert_each_passwd_with_name([])
    ent.assert_each_passwd_with_name([USER1])
    ent.assert_each_passwd_with_name(USER_LIST)
    try:
        ent.assert_each_passwd_with_name([dict(name="user3")])
        assert False
    except AssertionError as e:
        assert str(e) == "'getpwnam(): name not found: user3'"
    try:
        ent.assert_each_passwd_with_name([dict(name="user1", uid=1002)])
        assert False
    except AssertionError as e:
        assert str(e) == \
            "user 'user1' mismatch: 'uid' mismatch: 1002 != 1001"
예제 #2
0
파일: ent_test.py 프로젝트: pbrezina/sssd
def test_assert_each_passwd_with_name(users_and_groups):
    ent.assert_each_passwd_with_name([])
    ent.assert_each_passwd_with_name([USER1])
    ent.assert_each_passwd_with_name(USER_LIST)
    try:
        ent.assert_each_passwd_with_name([dict(name="user3")])
        assert False
    except AssertionError as e:
        assert str(e) == "'getpwnam(): name not found: user3'"
    try:
        ent.assert_each_passwd_with_name([dict(name="user1", uid=1002)])
        assert False
    except AssertionError as e:
        assert str(e) == \
            "user 'user1' mismatch: 'uid' mismatch: 1002 != 1001"
예제 #3
0
파일: ent_test.py 프로젝트: abbra/sssd
def test_assert_each_passwd_with_name(users_and_groups):
    ent.assert_each_passwd_with_name([])
    ent.assert_each_passwd_with_name([USER1])
    ent.assert_each_passwd_with_name(USER_LIST)
    try:
        ent.assert_each_passwd_with_name([dict(name="user3")])
        assert False
    except AssertionError, e:
        assert str(e) == "'getpwnam(): name not found: user3'"
예제 #4
0
파일: ent_test.py 프로젝트: spbnick/sssd
def test_assert_each_passwd_with_name(users_and_groups):
    ent.assert_each_passwd_with_name([])
    ent.assert_each_passwd_with_name([USER1])
    ent.assert_each_passwd_with_name(USER_LIST)
    try:
        ent.assert_each_passwd_with_name([dict(name="user3")])
        assert False
    except AssertionError, e:
        assert str(e) == "'getpwnam(): name not found: user3'"
예제 #5
0
파일: ent_test.py 프로젝트: abbra/sssd
        assert False
    except AssertionError, e:
        assert str(e) == \
               "user 1001 mismatch: 'uid' mismatch: 1002 != 1001"

def test_assert_each_passwd_with_name(users_and_groups):
    ent.assert_each_passwd_with_name([])
    ent.assert_each_passwd_with_name([USER1])
    ent.assert_each_passwd_with_name(USER_LIST)
    try:
        ent.assert_each_passwd_with_name([dict(name="user3")])
        assert False
    except AssertionError, e:
        assert str(e) == "'getpwnam(): name not found: user3'"
    try:
        ent.assert_each_passwd_with_name([dict(name="user1", uid=1002)])
        assert False
    except AssertionError, e:
        assert str(e) == \
               "user 'user1' mismatch: 'uid' mismatch: 1002 != 1001"

def test_assert_each_passwd_with_uid(users_and_groups):
    ent.assert_each_passwd_with_uid([])
    ent.assert_each_passwd_with_uid([USER1])
    ent.assert_each_passwd_with_uid(USER_LIST)
    try:
        ent.assert_each_passwd_with_uid([dict(uid=1003)])
        assert False
    except AssertionError, e:
        assert str(e) == "'getpwuid(): uid not found: 1003'"
    try:
예제 #6
0
파일: ent_test.py 프로젝트: spbnick/sssd
    except AssertionError, e:
        assert str(e) == \
               "user 1001 mismatch: 'uid' mismatch: 1002 != 1001"


def test_assert_each_passwd_with_name(users_and_groups):
    ent.assert_each_passwd_with_name([])
    ent.assert_each_passwd_with_name([USER1])
    ent.assert_each_passwd_with_name(USER_LIST)
    try:
        ent.assert_each_passwd_with_name([dict(name="user3")])
        assert False
    except AssertionError, e:
        assert str(e) == "'getpwnam(): name not found: user3'"
    try:
        ent.assert_each_passwd_with_name([dict(name="user1", uid=1002)])
        assert False
    except AssertionError, e:
        assert str(e) == \
               "user 'user1' mismatch: 'uid' mismatch: 1002 != 1001"


def test_assert_each_passwd_with_uid(users_and_groups):
    ent.assert_each_passwd_with_uid([])
    ent.assert_each_passwd_with_uid([USER1])
    ent.assert_each_passwd_with_uid(USER_LIST)
    try:
        ent.assert_each_passwd_with_uid([dict(uid=1003)])
        assert False
    except AssertionError, e:
        assert str(e) == "'getpwuid(): uid not found: 1003'"