Fixes tests to add a valid card type, fixes well test verbiage, converts card type from button label

This commit is contained in:
Patrick McDonagh
2016-11-17 16:48:04 -06:00
parent 19738f489f
commit 4ab0ccaa1a
3 changed files with 38 additions and 38 deletions

View File

@@ -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])