示例#1
0
 def test_validate_contributions_2(self):
     """
     Unit test validate contributions 2
     """
     state = SmartState()
     contributions = np.array([[2, 1], [8, 4]])
     x_pred = pd.DataFrame([[1, 2], [3, 4]],
                           columns=['Col1', 'Col2'],
                           index=['Id1', 'Id2'])
     expected_output = pd.DataFrame([[2, 1], [8, 4]],
                                    columns=['Col1', 'Col2'],
                                    index=['Id1', 'Id2'])
     output = state.validate_contributions(contributions, x_pred)
     assert not pd.testing.assert_frame_equal(expected_output, output)
示例#2
0
 def test_validate_contributions_1(self):
     """
     Unit test validate contributions
     Parameters
     ----------
     unittest : [type]
         [description]
     """
     state = SmartState()
     x_pred = Mock()
     contributions = pd.DataFrame([[2, 1], [8, 4]],
                                  columns=['Col1', 'Col2'],
                                  index=['Id1', 'Id2'])
     expected_output = contributions
     output = state.validate_contributions(contributions, x_pred)
     assert not pd.testing.assert_frame_equal(expected_output, output)