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

@@ -48,7 +48,7 @@
<td style="vertical-align: middle;text-align:center;"><input type="checkbox" ng-model="card.selected"></a></td>
<td style="vertical-align: middle;text-align:center;"><a href="/#/cards/{{card._id}}">{{card.created_on | date: "medium"}}</a></td>
<!-- <td style="vertical-align: middle;text-align:center;">{{card.Fillage_Percent | number: 2}} %</td> -->
<td style="vertical-align: middle;text-align:center;"><span class="btn" ng-class="{'btn-success':card.stroke_type=='Normal', 'btn-primary': card.stroke_type=='Shutdown', 'btn-danger': card.stroke_type=='Alarm', 'btn-warning':card.stroke_type=='Low Fillage',}">{{card.stroke_type}}</span></td>
<td style="vertical-align: middle;text-align:center;"><h5><span class="label" ng-class="{'label-success':card.stroke_type=='Normal', 'label-primary': card.stroke_type=='Shutdown', 'label-danger': card.stroke_type=='Alarm', 'label-warning':card.stroke_type=='Low Fillage'}">{{card.stroke_type}}</span></h5></td>
<td style="vertical-align: middle;text-align:center;"><a href="/csv/{{card.id}}" class="btn btn-primary active">Download CSV</a></td>
</tr>

View File

@@ -225,7 +225,7 @@
</tbody>
</table>
<div ng-if="well_test_vals.length==0" class="well" style="text-align:center">No stored notes yet.</div>
<div ng-if="well_test_vals.length==0" class="well" style="text-align:center">No stored tests yet.</div>
</div>
</div>
</div>

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