Skip to content

Commit

Permalink
Don't return from from Blob.validate, and pick up latest UI.
Browse files Browse the repository at this point in the history
  • Loading branch information
bhearsum committed Jan 26, 2016
1 parent 610efbf commit c280040
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 14 deletions.
2 changes: 0 additions & 2 deletions auslib/blobs/base.py
Expand Up @@ -76,8 +76,6 @@ def validate(self):
errors = [e.message for e in validator.iter_errors(self)]
if errors:
raise BlobValidationError("Invalid blob! See 'errors' for details.", errors)
else:
return True

def getSchema(self):
def loadSchema():
Expand Down
25 changes: 16 additions & 9 deletions auslib/test/blobs/test_apprelease.py
Expand Up @@ -166,7 +166,8 @@ def setUp(self):
}""")

def testIsValid(self):
self.assertTrue(self.blob.validate())
# Raises on error
self.blob.validate()

def test2_0(self):
updateQuery = {
Expand Down Expand Up @@ -510,8 +511,9 @@ def setUp(self):
""")

def testIsValid(self):
self.assertTrue(self.blobJ2.validate())
self.assertTrue(self.blobK.validate())
# Raises on error
self.blobJ2.validate()
self.blobK.validate()

def testSchema2CompleteOnly(self):
updateQuery = {
Expand Down Expand Up @@ -665,7 +667,8 @@ def setUp(self):
""")

def testIsValid(self):
self.assertTrue(self.blobJ2.validate())
# Raises on error
self.blobJ2.validate()

def testCompleteOnly(self):
updateQuery = {
Expand Down Expand Up @@ -888,8 +891,9 @@ def setUp(self):
""")

def testIsValid(self):
self.assertTrue(self.blobF3.validate())
self.assertTrue(self.blobG2.validate())
# Raises on error
self.blobF3.validate()
self.blobG2.validate()

def testSchema3MultipleUpdates(self):
updateQuery = {
Expand Down Expand Up @@ -1118,7 +1122,8 @@ def setUp(self):
""")

def testIsValid(self):
self.assertTrue(self.blobH2.validate())
# Raises on error
self.blobH2.validate()

def testSchema4WithPartials(self):
updateQuery = {
Expand Down Expand Up @@ -1258,7 +1263,8 @@ def testConvertFromV3(self):
""")

v4Blob = ReleaseBlobV4.fromV3(v3Blob)
self.assertTrue(v4Blob.validate())
# Raises on error
v4Blob.validate()

expected = {
"name": "g2",
Expand Down Expand Up @@ -1324,7 +1330,8 @@ def testConvertFromV3Noop(self):
""")

v4Blob = ReleaseBlobV4.fromV3(v3Blob)
self.assertTrue(v4Blob.validate())
# Raises on error
v4Blob.validate()

expected = v3Blob.copy()
expected["schema_version"] = 4
Expand Down
2 changes: 1 addition & 1 deletion auslib/test/blobs/test_settings.py
Expand Up @@ -23,7 +23,7 @@ class TestSchemaSettings(unittest.TestCase):
def test_basic_blob(self):
self.blob = SettingsBlob()
self.blob.loadJSON(_DATA)
self.assertTrue(self.blob.validate())
self.blob.validate()

update_query = {
"product": "gg", "version": "3", "buildID": "1",
Expand Down
2 changes: 1 addition & 1 deletion auslib/test/blobs/test_whitelist.py
Expand Up @@ -21,7 +21,7 @@ class TestWhitelist(unittest.TestCase):
def test_whitelist_blob(self):
self.blob = WhitelistBlobV1()
self.blob.loadJSON(_DATA)
self.assertTrue(self.blob.validate())
self.blob.validate()

update_query = {
"product": "b2g", "version": "2.5", "buildID": "1",
Expand Down
2 changes: 1 addition & 1 deletion ui

0 comments on commit c280040

Please sign in to comment.