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"
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'"
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:
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'"