| 1 |
# --- BEGIN COPYRIGHT BLOCK --- |
| 2 |
# Copyright (C) 2021 Red Hat, Inc. |
| 3 |
# All rights reserved. |
| 4 |
# |
| 5 |
# License: GPL (version 3 or any later version). |
| 6 |
# See LICENSE for details. |
| 7 |
# --- END COPYRIGHT BLOCK --- |
| 8 |
# |
| 9 |
import os |
| 10 |
import pytest |
| 11 |
from lib389.idm.user import UserAccounts, Account |
| 12 |
from test389.topologies import topology_st as topo |
| 13 |
from lib389._constants import DEFAULT_SUFFIX |
| 14 |
|
| 15 |
|
| 16 |
def test_account_delete(topo): |
| 17 |
""" |
| 18 |
Test that delete function is working with Accounts/Account |
| 19 |
|
| 20 |
:id: 9b036f14-5144-4862-b18c-a6d91b7a1620 |
| 21 |
|
| 22 |
:setup: Standalone instance |
| 23 |
|
| 24 |
:steps: |
| 25 |
1. Create a test user. |
| 26 |
2. Delete the test user using Account class object. |
| 27 |
|
| 28 |
:expectedresults: |
| 29 |
1. Operation should be successful |
| 30 |
2. Operation should be successful |
| 31 |
""" |
| 32 |
users = UserAccounts(topo.standalone, DEFAULT_SUFFIX) |
| 33 |
users.create_test_user(uid=1001) |
| 34 |
account = Account(topo.standalone, f'uid=test_user_1001,ou=People,{DEFAULT_SUFFIX}') |
| 35 |
account.delete() |
| 36 |
|
| 37 |
|
| 38 |
if __name__ == '__main__': |
| 39 |
# Run isolated |
| 40 |
# -s for DEBUG mode |
| 41 |
CURRENT_FILE = os.path.realpath(__file__) |
| 42 |
pytest.main("-s %s" % CURRENT_FILE) |