示例#1
0
 def test_conga_all_values_the_same(self):
     # Variance should obviously be 0 for a measurement
     # made up of all the same values
     dates = pd.date_range("12:00 2020/09/11", periods=500, freq="5min")
     values = np.repeat(100, repeats=500)
     test_df = pd.DataFrame({GLUCOSE: values}, index=dates)
     index = indices.GVcongaX(df=test_df, calc_config=self.mock_5_mg_config)
     self.assertEqual(
         0,
         index.calculate(2),
         msg="Returned: {}. Expected 0".format(index.calculate(2)),
     )
示例#2
0
 def test_conga_call_on_not_pandas(self):
     index = indices.GVcongaX(df=self.simple_df,
                              calc_config=self.mock_5_mg_config)
     with self.assertRaises(ValueError):
         indices.GVcongaX.__call__(index, df="not pandas", hours=7)
示例#3
0
 def test_conga_calculate_hours_not_int(self):
     index = indices.GVcongaX(df=self.simple_df,
                              calc_config=self.mock_5_mg_config)
     with self.assertRaises(ValueError):
         index.calculate(hours="not int")