aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Wood <michael.g.wood@intel.com>2015-06-04 16:48:27 +0100
committerMichael Wood <michael.g.wood@intel.com>2015-06-04 16:48:27 +0100
commitff2c366377662407cb634da1e03a3999d08b31f4 (patch)
treeb431a42abbaa9584eecb1ffb0d246bd72c09f7bf
parent65979c6b8db91b622e2f376e390ca099fcc19bfc (diff)
downloaderror-report-web-ff2c366377662407cb634da1e03a3999d08b31f4.tar.gz
error-report-web-ff2c366377662407cb634da1e03a3999d08b31f4.tar.bz2
error-report-web-ff2c366377662407cb634da1e03a3999d08b31f4.zip
tests: Add check to see if the LEV distance value has been generated
Also added test for 200 on urls for the SimilarTo, Build and Details Signed-off-by: Michael Wood <michael.g.wood@intel.com>
-rwxr-xr-xPost/test.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/Post/test.py b/Post/test.py
index 1ff6e45..3ba5676 100755
--- a/Post/test.py
+++ b/Post/test.py
@@ -26,6 +26,8 @@ def data_runner (func):
compare_db_obj_with_payload(self, bfo[0])
+ self.assertIsNotNone(bfo[0].LEV_DISTANCE)
+
return wrap
def compare_db_obj_with_payload(self, bf_object):
@@ -75,6 +77,9 @@ class SimpleTest(unittest.TestCase):
response = self.client.get('/Errors/Details/1/')
self.assertEqual(response.status_code, 200)
+ response = self.client.get('/Errors/SimilarTo/1/')
+ self.assertEqual(response.status_code, 200)
+
# Opening test-payload.json and submitting it to server
# expecting json response 1st item inserted to db
@data_runner
@@ -98,7 +103,6 @@ class SimpleTest(unittest.TestCase):
self.assertEqual("tester" in data_ob.BUILD.NAME, True)
-
@data_runner
def test_submission_0_3(self):
with open("test-data/test-payload.json") as f:
@@ -224,3 +228,12 @@ class SimpleTest(unittest.TestCase):
self.assertEqual(response.status_code, 200)
response = self.client.get("/Errors/Latest/?order_by=-iojqwef&filter=wefwef&type=dewwef&limit=wefe&page=wefwef")
self.assertEqual(response.status_code, 200)
+
+ response = self.client.get("/Errors/Build/9898989898/")
+ self.assertEqual(response.status_code, 200)
+
+ response = self.client.get("/Errors/SimilarTo/9898989898/")
+ self.assertEqual(response.status_code, 200)
+
+ response = self.client.get("/Errors/Details/9898989898/")
+ self.assertEqual(response.status_code, 200)