diff options
| author | Ed Bartosh <ed.bartosh@linux.intel.com> | 2015-08-10 18:27:15 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-08-10 13:58:01 -0700 |
| commit | 3ba3cf22d612637583978f3b32e80cfa29161aa7 (patch) | |
| tree | d2ecb01975c0028c611d6103cce2c490f5c8101d | |
| parent | b3ab9b1211a49712bc703bbe018ad125fa9d8418 (diff) | |
| download | poky-3ba3cf22d612637583978f3b32e80cfa29161aa7.tar.gz | |
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>
| -rw-r--r-- | bitbake/lib/toaster/toastergui/tests.py | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/bitbake/lib/toaster/toastergui/tests.py b/bitbake/lib/toaster/toastergui/tests.py index 1ed83dceda..723348dd57 100644 --- a/bitbake/lib/toaster/toastergui/tests.py +++ b/bitbake/lib/toaster/toastergui/tests.py | |||
| @@ -82,10 +82,7 @@ class ViewTests(TestCase): | |||
| 82 | self.assertEqual(response.status_code, 200) | 82 | self.assertEqual(response.status_code, 200) |
| 83 | self.assertTrue(response['Content-Type'].startswith('application/json')) | 83 | self.assertTrue(response['Content-Type'].startswith('application/json')) |
| 84 | 84 | ||
| 85 | try: | 85 | data = json.loads(response.content) |
| 86 | data = json.loads(response.content) | ||
| 87 | except: | ||
| 88 | self.fail("Response %s is not json-loadable" % response.content) | ||
| 89 | 86 | ||
| 90 | self.assertTrue("error" in data) | 87 | self.assertTrue("error" in data) |
| 91 | self.assertEqual(data["error"], "ok") | 88 | self.assertEqual(data["error"], "ok") |
| @@ -113,10 +110,8 @@ class ViewTests(TestCase): | |||
| 113 | self.assertEqual(response.status_code, 200) | 110 | self.assertEqual(response.status_code, 200) |
| 114 | self.assertTrue(response['Content-Type'].startswith('application/json')) | 111 | self.assertTrue(response['Content-Type'].startswith('application/json')) |
| 115 | 112 | ||
| 116 | try: | 113 | data = json.loads(response.content) |
| 117 | data = json.loads(response.content) | 114 | |
| 118 | except: | ||
| 119 | self.fail("Response %s is not json-loadable" % response.content) | ||
| 120 | self.assertTrue("error" in data) | 115 | self.assertTrue("error" in data) |
| 121 | self.assertEqual(data["error"], "ok") | 116 | self.assertEqual(data["error"], "ok") |
| 122 | self.assertTrue("results" in data) | 117 | self.assertTrue("results" in data) |
