-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_manage.py
53 lines (33 loc) · 1.01 KB
/
test_manage.py
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
52
53
import pytest
from htagweb import manage
from htagweb.hrclient import HrClient
@pytest.mark.asyncio
async def test_manage():
assert manage.users() == []
try:
hr=HrClient("ut2","examples.simple.App")
assert manage.users() == []
htm=await hr.create("//js") # will create fifo/process
ll=manage.users()
assert len(ll) == 1
assert ll[0].uid == "ut2"
assert ll[0].apps[0].cdate
assert ll[0].apps[0].mdate
ll[0].apps[0].kill()
assert manage.users() == []
finally:
await HrClient.clean()
@pytest.mark.asyncio
async def test_manage_kill_user():
assert manage.users() == []
try:
hr=HrClient("ut2","examples.simple.App")
assert manage.users() == []
htm=await hr.create("//js") # will create fifo/process
ll=manage.users()
assert len(ll) == 1
assert ll[0].uid == "ut2"
ll[0].kill()
assert manage.users() == []
finally:
await HrClient.clean()