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