def test_hypoglycemia_call_not_dataframe(self): index = indices.GVhypoglycemia(df=self.simple_df, calc_config=self.mock_5_mg_config) with self.assertRaises(ValueError): index("test", threshold=7)
def test_hypoglycemia_wrong_threshold_type(self): index = indices.GVhypoglycemia(df=self.simple_df, calc_config=self.mock_5_mg_config) with self.assertRaises(ValueError): index.calculate("test")
def test_hypoglycemia_custom_call(self): index = indices.GVhypoglycemia(df=self.simple_df, calc_config=self.mock_5_mg_config) self.assertEqual(index(df=self.simple_df, threshold=3), index.calculate(3))
def test_hypoglycemia(self): index = indices.GVhypoglycemia(df=self.simple_df, calc_config=self.mock_5_mg_config) self.assertEqual(first=index.calculate(3), second=0.4)