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()
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()
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)))
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()