コード例 #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'"