def test_signficance_of_relationship_lm(monkeypatch): monkeypatch.setattr(Processor, 'dimension_value_frame', mock_dim_value_frame) mock_data = mock_dim_value_frame(None, None, None) exp_arr_1 = mock_data['dimension_as_num'] exp_arr_2 = mock_data['value'] exp = linregress(exp_arr_1, exp_arr_2)[3] p = Processor() a = Analyzer(processor=p) p_val = a.significance_of_relationship('D1', 'Q1', 'linearmodel') assert p_val == exp
def test_signficance_of_relationship(monkeypatch): monkeypatch.setattr(Processor, 'dimension_value_frame', mock_dim_value_frame) mock_data = mock_dim_value_frame(None, None, None) exp_arr_1 = mock_data.ix[mock_data.dimension == 'D1', 'value'] exp_arr_2 = mock_data.ix[mock_data.dimension == 'D2', 'value'] exp = kruskalwallis(exp_arr_1, exp_arr_2)[1] p = Processor() a = Analyzer(processor=p) p_val = a.significance_of_relationship('D1', 'Q1', 'kruskalwallis') assert p_val == exp