Example #1
0
 def test_count_outliers(self):
     """
         Test whether the function returns the right values.
     """
     from flask_monitoringdashboard.database.count import count_outliers
     with session_scope() as db_session:
         self.assertEqual(count_outliers(db_session, ENDPOINT_ID),
                          OUTLIER_COUNT)
def num_outliers(endpoint_id):
    with session_scope() as db_session:
        return jsonify(count_outliers(db_session, endpoint_id))
 def test_count_outliers(self):
     with session_scope() as db_session:
         self.assertEqual(count_outliers(db_session, ENDPOINT_ID),
                          OUTLIER_COUNT)
         self.assertEqual(count_outliers(db_session, ENDPOINT_ID + 1), 0)
Example #4
0
def test_count_outliers(session, endpoint, non_existing_endpoint_id):
    assert count_outliers(session, endpoint.id) == 1
    assert count_outliers(session, non_existing_endpoint_id) == 0
Example #5
0
def test_count_outliers(session, endpoint):
    assert count_outliers(session, endpoint.id) == 2