示例#1
0
文件: ent_test.py 项目: vtapia/sssd
def test_assert_each_group_with_name(users_and_groups):
    ent.assert_each_group_with_name([])
    ent.assert_each_group_with_name([GROUP1])
    ent.assert_each_group_with_name(GROUP_LIST)
    try:
        ent.assert_each_group_with_name([dict(name="group3")])
        assert False
    except AssertionError as e:
        assert str(e) == "'getgrnam(): name not found: group3'"
    try:
        ent.assert_each_group_with_name([dict(name="group1", gid=2002)])
        assert False
    except AssertionError as e:
        assert str(e) == \
            "group 'group1' mismatch: 'gid' mismatch: 2002 != 2001"
示例#2
0
文件: ent_test.py 项目: pbrezina/sssd
def test_assert_each_group_with_name(users_and_groups):
    ent.assert_each_group_with_name([])
    ent.assert_each_group_with_name([GROUP1])
    ent.assert_each_group_with_name(GROUP_LIST)
    try:
        ent.assert_each_group_with_name([dict(name="group3")])
        assert False
    except AssertionError as e:
        assert str(e) == "'getgrnam(): name not found: group3'"
    try:
        ent.assert_each_group_with_name([dict(name="group1", gid=2002)])
        assert False
    except AssertionError as e:
        assert str(e) == \
            "group 'group1' mismatch: 'gid' mismatch: 2002 != 2001"
示例#3
0
文件: ent_test.py 项目: abbra/sssd
def test_assert_each_group_with_name(users_and_groups):
    ent.assert_each_group_with_name([])
    ent.assert_each_group_with_name([GROUP1])
    ent.assert_each_group_with_name(GROUP_LIST)
    try:
        ent.assert_each_group_with_name([dict(name="group3")])
        assert False
    except AssertionError, e:
        assert str(e) == "'getgrnam(): name not found: group3'"
示例#4
0
文件: ent_test.py 项目: spbnick/sssd
def test_assert_each_group_with_name(users_and_groups):
    ent.assert_each_group_with_name([])
    ent.assert_each_group_with_name([GROUP1])
    ent.assert_each_group_with_name(GROUP_LIST)
    try:
        ent.assert_each_group_with_name([dict(name="group3")])
        assert False
    except AssertionError, e:
        assert str(e) == "'getgrnam(): name not found: group3'"
示例#5
0
文件: ent_test.py 项目: abbra/sssd
        assert False
    except AssertionError, e:
        assert str(e) == \
               "group 2001 mismatch: 'gid' mismatch: 2002 != 2001"

def test_assert_each_group_with_name(users_and_groups):
    ent.assert_each_group_with_name([])
    ent.assert_each_group_with_name([GROUP1])
    ent.assert_each_group_with_name(GROUP_LIST)
    try:
        ent.assert_each_group_with_name([dict(name="group3")])
        assert False
    except AssertionError, e:
        assert str(e) == "'getgrnam(): name not found: group3'"
    try:
        ent.assert_each_group_with_name([dict(name="group1", gid=2002)])
        assert False
    except AssertionError, e:
        assert str(e) == \
               "group 'group1' mismatch: 'gid' mismatch: 2002 != 2001"

def test_assert_each_group_with_gid(users_and_groups):
    ent.assert_each_group_with_gid([])
    ent.assert_each_group_with_gid([GROUP1])
    ent.assert_each_group_with_gid(GROUP_LIST)
    try:
        ent.assert_each_group_with_gid([dict(gid=2003)])
        assert False
    except AssertionError, e:
        assert str(e) == "'getgrgid(): gid not found: 2003'"
    try:
示例#6
0
文件: ent_test.py 项目: spbnick/sssd
    except AssertionError, e:
        assert str(e) == \
               "group 2001 mismatch: 'gid' mismatch: 2002 != 2001"


def test_assert_each_group_with_name(users_and_groups):
    ent.assert_each_group_with_name([])
    ent.assert_each_group_with_name([GROUP1])
    ent.assert_each_group_with_name(GROUP_LIST)
    try:
        ent.assert_each_group_with_name([dict(name="group3")])
        assert False
    except AssertionError, e:
        assert str(e) == "'getgrnam(): name not found: group3'"
    try:
        ent.assert_each_group_with_name([dict(name="group1", gid=2002)])
        assert False
    except AssertionError, e:
        assert str(e) == \
               "group 'group1' mismatch: 'gid' mismatch: 2002 != 2001"


def test_assert_each_group_with_gid(users_and_groups):
    ent.assert_each_group_with_gid([])
    ent.assert_each_group_with_gid([GROUP1])
    ent.assert_each_group_with_gid(GROUP_LIST)
    try:
        ent.assert_each_group_with_gid([dict(gid=2003)])
        assert False
    except AssertionError, e:
        assert str(e) == "'getgrgid(): gid not found: 2003'"