result, out, err = self.runcmd("domain", "auth", "policy", "create",
"--name", "createFails")
self.assertEqual(result, -1)
- self.assertIn("ERROR: Custom error message", err)
+ self.assertIn("Custom error message", err)
def test_authentication_policy_modify_description(self):
"""Test modifying an authentication policy description."""
"--name", "doesNotExist",
"--description", "NewDescription")
self.assertEqual(result, -1)
- self.assertIn("ERROR: Authentication policy doesNotExist not found.",
- err)
+ self.assertIn("Authentication policy doesNotExist not found.", err)
def test_authentication_policy_modify_audit_enforce(self):
"""Test modify authentication policy using --audit and --enforce."""
"--name", "Single Policy",
"--description", "New description")
self.assertEqual(result, -1)
- self.assertIn("ERROR: Custom error message", err)
+ self.assertIn("Custom error message", err)
def test_authentication_policy_delete(self):
"""Test deleting an authentication policy that is not protected."""
"--name", "deleteForceFail",
"--force")
self.assertEqual(result, -1)
- self.assertIn("ERROR: Custom error message", err)
+ self.assertIn("Custom error message", err)
def test_authentication_policy_delete_fails(self):
"""Test deleting an authentication policy, but it fails."""
result, out, err = self.runcmd("domain", "auth", "policy", "delete",
"--name", "regularPolicy")
self.assertEqual(result, -1)
- self.assertIn("ERROR: Custom error message", err)
+ self.assertIn("Custom error message", err)
# When not using --force we get a hint.
self.assertIn("Try --force", err)
"--name", "protectedPolicy",
"--force")
self.assertEqual(result, -1)
- self.assertIn("ERROR: Custom error message", err)
+ self.assertIn("Custom error message", err)
# When using --force we don't get the hint.
self.assertNotIn("Try --force", err)
result, out, err = self.runcmd("domain", "auth", "silo", "view",
"--name", "doesNotExist")
self.assertEqual(result, -1)
- self.assertIn("ERROR: Authentication silo doesNotExist not found.", err)
+ self.assertIn("Authentication silo doesNotExist not found.", err)
def test_authentication_silo_view_name_required(self):
"""Test view authentication silo without --name argument."""
"--name", "createFails",
"--policy", "Single Policy")
self.assertEqual(result, -1)
- self.assertIn("ERROR: Custom error message", err)
+ self.assertIn("Custom error message", err)
def test_authentication_silo_modify_description(self):
"""Test modify authentication silo changing the description field."""
"--name", "doesNotExist",
"--description=NewDescription")
self.assertEqual(result, -1)
- self.assertIn("ERROR: Authentication silo doesNotExist not found.", err)
+ self.assertIn("Authentication silo doesNotExist not found.", err)
def test_authentication_silo_modify_name_missing(self):
"""Test modify authentication silo without --name argument."""
"--name", "developers",
"--description", "Devs")
self.assertEqual(result, -1)
- self.assertIn("ERROR: Custom error message", err)
+ self.assertIn("Custom error message", err)
def test_authentication_silo_delete(self):
"""Test deleting an authentication silo that is not protected."""
"--name", "deleteForceFail",
"--force")
self.assertEqual(result, -1)
- self.assertIn("ERROR: Custom error message", err)
+ self.assertIn("Custom error message", err)
def test_authentication_silo_delete_fails(self):
"""Test deleting an authentication silo, but it fails."""
result, out, err = self.runcmd("domain", "auth", "silo", "delete",
"--name", "regularSilo")
self.assertEqual(result, -1)
- self.assertIn("ERROR: Custom error message", err)
+ self.assertIn("Custom error message", err)
# When not using --force we get a hint.
self.assertIn("Try --force", err)
"--name", "protectedSilo",
"--force")
self.assertEqual(result, -1)
- self.assertIn("ERROR: Custom error message", err)
+ self.assertIn("Custom error message", err)
# When using --force we don't get the hint.
self.assertNotIn("Try --force", err)
"""Test view claim type without --name is handled."""
result, out, err = self.runcmd("domain", "claim", "claim-type", "view")
self.assertEqual(result, -1)
- self.assertIn("ERROR: Argument --name is required.", err)
+ self.assertIn("Argument --name is required.", err)
def test_claim_type_view_notfound(self):
"""Test viewing claim type that doesn't exist is handled."""
result, out, err = self.runcmd("domain", "claim", "claim-type",
"view", "--name", "doesNotExist")
self.assertEqual(result, -1)
- self.assertIn("ERROR: Claim type doesNotExist not found.", err)
+ self.assertIn("Claim type doesNotExist not found.", err)
def test_claim_type_create(self):
"""Test creating several known attributes as claim types.
"create", "--attribute=wWWHomePage",
"--name=homepage")
self.assertEqual(result, -1)
- self.assertIn("ERROR: Argument --class is required.", err)
+ self.assertIn("Argument --class is required.", err)
def test_claim_type_delete(self):
"""Test deleting a claim type that is not protected."""
result, out, err = self.runcmd("domain", "claim", "claim-type",
"delete", "--name", "doesNotExist")
self.assertEqual(result, -1)
- self.assertIn("ERROR: Claim type doesNotExist not found.", err)
+ self.assertIn("Claim type doesNotExist not found.", err)
def test_claim_type_modify_description(self):
"""Test modifying a claim type description."""
"modify", "--name", "seeAlso",
"--class=")
self.assertEqual(result, -1)
- self.assertIn("ERROR: Class name is required.", err)
+ self.assertIn("Class name is required.", err)
# Try changing it to just --class=computer first.
result, out, err = self.runcmd("domain", "claim", "claim-type",
"modify", "--name", "doesNotExist",
"--description=NewDescription")
self.assertEqual(result, -1)
- self.assertIn("ERROR: Claim type doesNotExist not found.", err)
+ self.assertIn("Claim type doesNotExist not found.", err)
def test_value_type_list(self):
"""Test listing claim value types in list format."""
"""Test viewing a claim value type with missing --name is handled."""
result, out, err = self.runcmd("domain", "claim", "value-type", "view")
self.assertEqual(result, -1)
- self.assertIn("ERROR: Argument --name is required.", err)
+ self.assertIn("Argument --name is required.", err)
def test_value_type_view_notfound(self):
"""Test viewing a claim value type that doesn't exist is handled."""
result, out, err = self.runcmd("domain", "claim", "value-type",
"view", "--name", "doesNotExist")
self.assertEqual(result, -1)
- self.assertIn("ERROR: Value type doesNotExist not found.", err)
+ self.assertIn("Value type doesNotExist not found.", err)