示例#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'"