1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-09 05:29:32 +00:00

bitbake: toaster: don't catch json.load exceptions

It doesn't make sense to catch json.load exceptions in the
testing code. If API throws traceback it's better to see
it instead of error message.

(Bitbake rev: 207cb1d16ab089995f23b6070be358870506aa62)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Ed Bartosh
2015-08-10 18:27:15 +01:00
committed by Richard Purdie
parent b3ab9b1211
commit 3ba3cf22d6
+3 -8
View File
@@ -82,10 +82,7 @@ class ViewTests(TestCase):
self.assertEqual(response.status_code, 200)
self.assertTrue(response['Content-Type'].startswith('application/json'))
try:
data = json.loads(response.content)
except:
self.fail("Response %s is not json-loadable" % response.content)
data = json.loads(response.content)
self.assertTrue("error" in data)
self.assertEqual(data["error"], "ok")
@@ -113,10 +110,8 @@ class ViewTests(TestCase):
self.assertEqual(response.status_code, 200)
self.assertTrue(response['Content-Type'].startswith('application/json'))
try:
data = json.loads(response.content)
except:
self.fail("Response %s is not json-loadable" % response.content)
data = json.loads(response.content)
self.assertTrue("error" in data)
self.assertEqual(data["error"], "ok")
self.assertTrue("results" in data)