Beispiel #1
0
    def test_create_role_wrong_permissions_2(self):
        permissions = iroha.StringVector()
        permissions.append("can_receive")
        permissions.append("wrong_permission")

        with self.assertRaises(ValueError):
            self.base().createRole("user", permissions).build()
Beispiel #2
0
    def test_create_role_with_invalid_name(self):
        permissions = iroha.StringVector()
        permissions.append("can_receive")
        permissions.append("can_get_roles")

        for name in INVALID_NAMES_1:
            with self.assertRaises(ValueError):
                self.base().createRole(name, permissions).build()
Beispiel #3
0
    def test_create_role(self):
        permissions = iroha.StringVector()
        permissions.append("can_receive")
        permissions.append("can_get_roles")
        self.assertTrue(permissions.size() == 2)

        for name in VALID_NAMES_1:
            tx = self.builder.createRole(name, permissions).build()
            self.assertTrue(self.check_proto_tx(self.proto(tx)))
Beispiel #4
0
    def test_create_role_with_empty_permissions(self):
        permissions = iroha.StringVector()
        self.assertTrue(permissions.size() == 0)

        with self.assertRaises(ValueError):
            self.base().createRole("user", permissions).build()