def test_chisquare_dimension(self): test_dimension = ChiSquare(self.data_frame, self.df_helper, self.df_context, self.meta_parser).test_dimension( 'Price_Range', 'Source') self.assertAlmostEqual(test_dimension.get_pvalue(), exp_values['pval']['Price_Range-Source'], places=5) self.assertAlmostEqual(test_dimension.get_effect_size(), exp_values['effect_size']['Price_Range-Source'], places=5) self.assertAlmostEqual(test_dimension.get_stat(), exp_values['stats']['Price_Range-Source'], places=5) self.assertAlmostEqual(test_dimension.get_v_value(), exp_values['v_value']['Price_Range-Source'], places=5)
def test_chisquare_measure(self): test_measures = ChiSquare(self.data_frame, self.df_helper, self.df_context, self.meta_parser).test_measures( 'Price_Range', 'Marketing_Cost') self.assertAlmostEqual( test_measures.get_pvalue(), exp_values['pval']['Price_Range-Marketing_Cost'], places=5) self.assertAlmostEqual( test_measures.get_effect_size(), exp_values['effect_size']['Price_Range-Marketing_Cost'], places=5) self.assertAlmostEqual( test_measures.get_stat(), exp_values['stats']['Price_Range-Marketing_Cost'], places=5) self.assertAlmostEqual( test_measures.get_v_value(), exp_values['v_value']['Price_Range-Marketing_Cost'], places=5)