-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconftest.py
More file actions
51 lines (38 loc) · 966 Bytes
/
conftest.py
File metadata and controls
51 lines (38 loc) · 966 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import time
from pytest import fixture
from pywebui import Connector
HOST = 'http://10.11.102.21:8082/'
USERNAME = 'TESTUSER'
PASSWORD = 'testuser'
@fixture
def hostname():
return HOST
@fixture(scope="session")
def auth_username():
return USERNAME
@fixture(scope="session")
def connector():
c = Connector(HOST)
c.login(USERNAME, PASSWORD)
time.sleep(1)
return c
@fixture
def tmp_username():
return 'TESTAPIUSER'
@fixture(scope="function")
def user(connector, tmp_username):
connector.delete_user(tmp_username)
user = connector.create_user(
username=tmp_username,
owner=tmp_username,
password="asd123asd123",
uic=("312", "77"),
def_priv=["NETMBX","TMPMBX"],
device="SYS$SYSDEVICE",
directory=f"[{tmp_username}]",
pwd_expired=False,
priv=["NETMBX","TMPMBX"],
flags=["DISUSER"],
)
yield user
connector.delete_user(tmp_username)