-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathtest_rbac_small.py
37 lines (30 loc) · 1.19 KB
/
test_rbac_small.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
import unittest
from pprint import pprint
from peerplays import PeerPlays
from peerplaysbase.operationids import getOperationNameForId
from peerplays.instance import set_shared_peerplays_instance
from .fixtures import fixture_data, peerplays, core_unit
class Testcases(unittest.TestCase):
def setUp(self):
fixture_data()
self.testperm = "testperm1"
self.clean_previous_test()
def clean_previous_test(self):
custom_permissions_existing = peerplays.rpc.get_custom_permissions("1.2.7")
for permission in custom_permissions_existing:
if permission["permission_name"] == self.testperm:
permission_id = permission['id']
peerplays.custom_permission_delete(
permission_id,
owner_account="1.2.7")
print(self.testperm, " deleted!")
print("Cleaning done!")
def test_custom_permission_create(self):
peerplays.custom_permission_create(
self.testperm,
owner_account="1.2.7",
weight_threshold=1,
account_auths=[["1.2.8", 1]])
self.assertEqual(1, 1)
if __name__ == "__main__":
unittest.main()