コード例 #1
0
 def test_solution_to_dataframe(self):
     input_file = self.total_cost_cbc
     reader = ReadCbc()
     with StringIO(input_file) as file_buffer:
         actual = reader.read(file_buffer)
     expected = self.total_cost_otoole_df
     pd.testing.assert_frame_equal(actual[0]["TotalDiscountedCost"],
                                   expected["TotalDiscountedCost"])
コード例 #2
0
 def test_convert_cbc_to_csv_long_read(self, cbc_solution, input_data,
                                       expected):
     cbc_reader = ReadCbc()
     with StringIO(cbc_solution) as file_buffer:
         actual = cbc_reader.read(file_buffer,
                                  kwargs={"input_data": input_data
                                          })[0]["TotalDiscountedCost"]
     assert isinstance(actual, pd.DataFrame)
     pd.testing.assert_frame_equal(actual, expected["TotalDiscountedCost"])