示例#1
0
 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)
示例#2
0
 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")
示例#3
0
 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))
示例#4
0
 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)