From 4ab0ccaa1a0829e392ab54ac552c56a582764a5c Mon Sep 17 00:00:00 2001 From: Patrick McDonagh Date: Thu, 17 Nov 2016 16:48:04 -0600 Subject: [PATCH] Fixes tests to add a valid card type, fixes well test verbiage, converts card type from button label --- app/static/templates/cardlist.html | 2 +- app/static/templates/welltest.html | 2 +- tests/dbtests.py | 72 +++++++++++++++--------------- 3 files changed, 38 insertions(+), 38 deletions(-) diff --git a/app/static/templates/cardlist.html b/app/static/templates/cardlist.html index 0c10339..01bc75a 100644 --- a/app/static/templates/cardlist.html +++ b/app/static/templates/cardlist.html @@ -48,7 +48,7 @@ {{card.created_on | date: "medium"}} - {{card.stroke_type}} +
{{card.stroke_type}}
Download CSV diff --git a/app/static/templates/welltest.html b/app/static/templates/welltest.html index 64442e9..e1d6c3a 100644 --- a/app/static/templates/welltest.html +++ b/app/static/templates/welltest.html @@ -225,7 +225,7 @@ -
No stored notes yet.
+
No stored tests yet.
diff --git a/tests/dbtests.py b/tests/dbtests.py index f2113ad..b6fe305 100644 --- a/tests/dbtests.py +++ b/tests/dbtests.py @@ -82,24 +82,24 @@ def get_data(db_table, obj_id): # for x in test_tag: # self.assertTrue(test_tag[x] == tag_in_db[x]) -# class TestStroke(unittest.TestCase): -# def test_insert(self): -# test_card = { -# 'stroke_type': 'normal', -# 'stroke_number': 123, -# 'surf_pos': '[0.0, 90.0, 100.0, 25.0, 0.0]', -# 'surf_lod': '[15000.0, 20000.0, 20000.0, 15000.0, 15000.0]', -# 'down_pos': '[0.0, 0.0, 100.0, 100.0, 0.0]', -# 'down_lod': '[-10000.0, -5000.0, -5000.0, -10000.0, -10000.0]' -# } -# id_added = insert_data("cards", test_card) -# print("Added tag at _id {}".format(id_added)) -# -# if id_added > 0: -# stroke_in_db = get_data("cards", id_added) -# for x in test_card: -# print("testing {}: {} == {}".format(x, test_card[x], stroke_in_db[x])) -# self.assertTrue(test_card[x] == stroke_in_db[x]) +class TestStroke(unittest.TestCase): + def test_insert(self): + test_card = { + 'stroke_type': 'Normal', + 'stroke_number': 123, + 'surf_pos': '[0.0, 90.0, 100.0, 25.0, 0.0]', + 'surf_lod': '[15000.0, 20000.0, 20000.0, 15000.0, 15000.0]', + 'down_pos': '[0.0, 0.0, 100.0, 100.0, 0.0]', + 'down_lod': '[-10000.0, -5000.0, -5000.0, -10000.0, -10000.0]' + } + id_added = insert_data("cards", test_card) + print("Added tag at _id {}".format(id_added)) + + if id_added > 0: + stroke_in_db = get_data("cards", id_added) + for x in test_card: + print("testing {}: {} == {}".format(x, test_card[x], stroke_in_db[x])) + self.assertTrue(test_card[x] == stroke_in_db[x]) # class TestGaugeOff(unittest.TestCase): # def test_insert(self): @@ -201,24 +201,24 @@ def get_data(db_table, obj_id): # print("testing {}: {} == {}".format(x, test_bit_event[x], data_in_db[x])) # self.assertTrue(test_bit_event[x] == data_in_db[x]) -class TestWellTest(unittest.TestCase): - def test_insert(self): - # note_text = db.Column(db.String(256)) - # author = db.String(128) - - test_note = { - 'note_text': "THIS IS A TEST OF THE NOTE SYSTEM.", - 'author': "Patrick F-ing McDonagh" - } - - id_added = insert_data("notes", test_note) - print("Added note at _id {}".format(id_added)) - - if id_added > 0: - data_in_db = get_data("notes", id_added) - for x in test_note: - print("testing {}: {} == {}".format(x, test_note[x], data_in_db[x])) - self.assertTrue(test_note[x] == data_in_db[x]) +# class TestWellTest(unittest.TestCase): +# def test_insert(self): +# # note_text = db.Column(db.String(256)) +# # author = db.String(128) +# +# test_note = { +# 'note_text': "THIS IS A TEST OF THE NOTE SYSTEM.", +# 'author': "Patrick F-ing McDonagh" +# } +# +# id_added = insert_data("notes", test_note) +# print("Added note at _id {}".format(id_added)) +# +# if id_added > 0: +# data_in_db = get_data("notes", id_added) +# for x in test_note: +# print("testing {}: {} == {}".format(x, test_note[x], data_in_db[x])) +# self.assertTrue(test_note[x] == data_in_db[x])