Beispiel #1
0
 def test_cli(self, df_from_input_mock, show_mock):
     df_in = pd.DataFrame({
         'x': range(1, 101)
     })
     df_from_input_mock.return_value = df_in
     main()
     self.assertTrue(show_mock.called)
Beispiel #2
0
 def test_cli_quiet(self, df_from_input_mock, df_to_output_mock):
     df_in = pd.DataFrame({'x': range(1, 101)})
     df_from_input_mock.return_value = df_in
     main()
     df_out = df_to_output_mock.call_args_list[0][0][1]
     self.assertEqual(list(df_out.columns), ['x', 'p_less', 'p_greater'])
     self.assertEqual(len(df_out), 10)
Beispiel #3
0
 def test_cli_quiet(self, df_from_input_mock, df_to_output_mock):
     df_in = pd.DataFrame({
         'x': range(1, 101)
     })
     df_from_input_mock.return_value = df_in
     main()
     df_out = df_to_output_mock.call_args_list[0][0][1]
     self.assertEqual(list(df_out.columns), ['x', 'p_less', 'p_greater'])
     self.assertEqual(len(df_out), 10)
Beispiel #4
0
 def test_cli(self, df_from_input_mock, show_mock):
     df_in = pd.DataFrame({'x': range(1, 101)})
     df_from_input_mock.return_value = df_in
     main()
     self.assertTrue(show_mock.called)