예제 #1
0
 def test_get_bad_widgets(self):
     """
     Test to ensure we can get bad widgets
     """
     cnxn = get_db_cxn()
     bad_widgets = get_bad_widgets(cnxn)
     assert (len(bad_widgets) > 1)
 def test_get_lines_overview(self):
     """
     Test to ensure we can get a widget
     """
     cnxn = get_db_cxn()
     overview = lines.get_line_overviews(cnxn, "kitty hawk")
     assert(len(overview) > 0)
예제 #3
0
 def test_get_bad_widgets_to_json(self):
     """
     Ensures returns proper json string
     """
     cnxn = get_db_cxn()
     bad_widgets = get_bad_widgets(cnxn, to_json=True)
     assert (type(bad_widgets) is str)
 def test_anomaly_tred(self):
     """
     Test to ensure we can get a widget
     """
     cnxn = get_db_cxn()
     trend = factories.get_anomaly_trend(cnxn, "kitty hawk")
     assert (type(trend) is float)
예제 #5
0
 def test_get_widget(self):
     """
     Test to ensure we can get a widget
     """
     cnxn = get_db_cxn()
     widget = get_widget(cnxn, serial_number="w1")
     f_id = widget.factory_id
     assert (f_id == "kitty hawk")
     is_good = widget.classification.is_good
     assert (is_good is True)
예제 #6
0
 def test_count(self):
     """
     ensures we get a count back
     """
     cnxn = get_db_cxn()
     good_count = get_good_widgets_count(cnxn)
     bad_count = get_bad_widgets_count(cnxn)
     all_count = get_all_widgets_count(cnxn)
     assert (type(good_count) is int)
     assert (type(bad_count) is int)
     assert (type(all_count) is int)
 def test_get_all_line_overviews(self):
     cnxn = get_db_cxn()
     overviews = lines.get_all_overviews(cnxn)
     assert(len(overviews) > 0)
예제 #8
0
 def test_get_50_widgets_json(self):
     cnxn = get_db_cxn()
     widgets = cwidget.get_50_widgets(cnxn, to_json=True)
     assert (type(widgets) is str)
예제 #9
0
 def test_count_to_json_str(self):
     cnxn = get_db_cxn()
     counts = get_counts(cnxn)
     assert (type(counts) is str)
 def test_multiple_factory_overviews(self):
     cnxn = get_db_cxn()
     data = factories.get_all_overviews(cnxn)
     assert (type(data) is str)
 def test_factory_overview(self):
     cnxn = get_db_cxn()
     data = factories.get_factory_overview(cnxn, "kitty hawk")
     assert (type(data) is dict)
예제 #12
0
def lines_overview():
    cnxn = get_db_cxn()
    return l_provider.get_all_overviews(cnxn, as_json=True)
예제 #13
0
def overview():
    cnxn = get_db_cxn()
    return f_provider.get_all_overviews(cnxn)
예제 #14
0
def badwidgets():
    cnxn = get_db_cxn()
    badwidgets = get_bad_widgets(cnxn, to_json=True)
    return badwidgets
예제 #15
0
def counts():
    cnxn = get_db_cxn()
    return widgets_provider.get_counts(cnxn)
예제 #16
0
def fifty_widgets():
    cnxn = get_db_cxn()
    widgets = widgets_provider.get_50_widgets(cnxn, to_json=True)
    return widgets