[CI]: fix unittest failure
Change-Id: I5245d437a5703d5ff18011076395d25c040f5a4d
This commit is contained in:
parent
9c92df8152
commit
e9fa651ac0
@ -162,7 +162,7 @@ class TestClusterController(trove_testtools.TestCase):
|
||||
error_messages = [error.message for error in errors]
|
||||
error_paths = [error.path.pop() for error in errors]
|
||||
self.assertThat(len(errors), Is(2))
|
||||
self.assertIn("'' is too short", error_messages)
|
||||
self.assertIn("'' should be non-empty", error_messages)
|
||||
self.assertIn("'' does not match '^.*[0-9a-zA-Z]+.*$'", error_messages)
|
||||
self.assertIn("type", error_paths)
|
||||
|
||||
|
@ -89,7 +89,7 @@ class TestClusterController(trove_testtools.TestCase):
|
||||
error_messages = [error.message for error in errors]
|
||||
error_paths = [error.path.pop() for error in errors]
|
||||
self.assertThat(len(errors), Is(2))
|
||||
self.assertIn("'' is too short", error_messages)
|
||||
self.assertIn("'' should be non-empty", error_messages)
|
||||
self.assertIn("'' does not match '^.*[0-9a-zA-Z]+.*$'", error_messages)
|
||||
self.assertIn("type", error_paths)
|
||||
|
||||
|
@ -103,7 +103,7 @@ class TestClusterController(trove_testtools.TestCase):
|
||||
error_messages = [error.message for error in errors]
|
||||
error_paths = [error.path.pop() for error in errors]
|
||||
self.assertThat(len(errors), Is(2))
|
||||
self.assertIn("'' is too short", error_messages)
|
||||
self.assertIn("'' should be non-empty", error_messages)
|
||||
self.assertIn("'' does not match '^.*[0-9a-zA-Z]+.*$'", error_messages)
|
||||
self.assertIn("type", error_paths)
|
||||
|
||||
|
@ -89,7 +89,7 @@ class TestClusterController(trove_testtools.TestCase):
|
||||
error_messages = [error.message for error in errors]
|
||||
error_paths = [error.path.pop() for error in errors]
|
||||
self.assertThat(len(errors), Is(2))
|
||||
self.assertIn("'' is too short", error_messages)
|
||||
self.assertIn("'' should be non-empty", error_messages)
|
||||
self.assertIn("'' does not match '^.*[0-9a-zA-Z]+.*$'", error_messages)
|
||||
self.assertIn("type", error_paths)
|
||||
|
||||
|
@ -120,7 +120,7 @@ class TestConfigurationController(trove_testtools.TestCase):
|
||||
self._test_validate_configuration_with_action(body,
|
||||
action='create',
|
||||
is_valid=False))
|
||||
self.assertIn("'' is too short", error_messages)
|
||||
self.assertIn("'' should be non-empty", error_messages)
|
||||
|
||||
def test_validate_edit_configuration(self):
|
||||
body = {
|
||||
|
@ -284,7 +284,7 @@ class TestInstanceController(trove_testtools.TestCase):
|
||||
self.assertFalse(validator.is_valid(body))
|
||||
errors = sorted(validator.iter_errors(body), key=lambda e: e.path)
|
||||
self.verify_errors(errors[0].context,
|
||||
["'' is too short",
|
||||
["'' should be non-empty",
|
||||
"'' does not match '^.*[0-9a-zA-Z]+.*$'",
|
||||
"'' is not of type 'integer'"],
|
||||
["flavorRef", "flavorRef", "flavorRef",
|
||||
@ -299,7 +299,7 @@ class TestInstanceController(trove_testtools.TestCase):
|
||||
validator = jsonschema.Draft4Validator(schema)
|
||||
self.assertFalse(validator.is_valid(body))
|
||||
errors = sorted(validator.iter_errors(body), key=lambda e: e.path)
|
||||
self.verify_errors(errors, ["'' is too short"], ["flavorRef"])
|
||||
self.verify_errors(errors, ["'' should be non-empty"], ["flavorRef"])
|
||||
|
||||
def _setup_modify_instance_mocks(self):
|
||||
instance = Mock()
|
||||
|
@ -62,7 +62,7 @@ class TestUserController(trove_testtools.TestCase):
|
||||
error_messages = [error.message for error in errors]
|
||||
error_paths = [error.path.pop() for error in errors]
|
||||
self.assertThat(len(errors), Is(2))
|
||||
self.assertIn("'' is too short", error_messages)
|
||||
self.assertIn("'' should be non-empty", error_messages)
|
||||
self.assertIn("'' does not match '^.*[0-9a-zA-Z]+.*$'", error_messages)
|
||||
self.assertIn("password", error_paths)
|
||||
|
||||
@ -86,7 +86,7 @@ class TestUserController(trove_testtools.TestCase):
|
||||
error_paths = [error.path.pop() for error in errors]
|
||||
self.assertThat(len(errors), Is(3))
|
||||
self.assertIn("'password' is a required property", error_messages)
|
||||
self.assertIn("'' is too short", error_messages)
|
||||
self.assertIn("'' should be non-empty", error_messages)
|
||||
self.assertIn("'' does not match '^.*[0-9a-zA-Z]+.*$'", error_messages)
|
||||
self.assertIn("name", error_paths)
|
||||
|
||||
@ -185,7 +185,7 @@ class TestUserController(trove_testtools.TestCase):
|
||||
error_messages = [error.message for error in errors]
|
||||
error_paths = [error.path.pop() for error in errors]
|
||||
self.assertThat(len(errors), Is(2))
|
||||
self.assertIn("'' is too short", error_messages)
|
||||
self.assertIn("'' should be non-empty", error_messages)
|
||||
self.assertIn("'' does not match '^.*[0-9a-zA-Z]+.*$'", error_messages)
|
||||
self.assertIn("password", error_paths)
|
||||
|
||||
@ -199,7 +199,7 @@ class TestUserController(trove_testtools.TestCase):
|
||||
error_messages = [error.message for error in errors]
|
||||
error_paths = [error.path.pop() for error in errors]
|
||||
self.assertThat(len(errors), Is(2))
|
||||
self.assertIn("'' is too short", error_messages)
|
||||
self.assertIn("'' should be non-empty", error_messages)
|
||||
self.assertIn("'' does not match '^.*[0-9a-zA-Z]+.*$'", error_messages)
|
||||
self.assertIn("password", error_paths)
|
||||
|
||||
@ -213,7 +213,7 @@ class TestUserController(trove_testtools.TestCase):
|
||||
error_messages = [error.message for error in errors]
|
||||
error_paths = [error.path.pop() for error in errors]
|
||||
self.assertThat(len(errors), Is(2))
|
||||
self.assertIn("'' is too short", error_messages)
|
||||
self.assertIn("'' should be non-empty", error_messages)
|
||||
self.assertIn("password", error_paths)
|
||||
|
||||
def test_validate_update_no_password(self):
|
||||
@ -252,7 +252,7 @@ class TestUserController(trove_testtools.TestCase):
|
||||
error_paths = [error.path.pop() for error in errors]
|
||||
self.assertThat(len(errors), Is(3))
|
||||
self.assertIn("'password' is a required property", error_messages)
|
||||
self.assertIn("'' is too short", error_messages)
|
||||
self.assertIn("'' should be non-empty", error_messages)
|
||||
self.assertIn("'' does not match '^.*[0-9a-zA-Z]+.*$'", error_messages)
|
||||
self.assertIn("name", error_paths)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user