def test_over_column(self):
     controller.askopenfilename = Mock(
         return_value='C:/school/guide_dog/resource/Over column.csv')
     controller.popup_format_error = Mock(return_value='')
     controller.popup_msg = Mock(return_value='')
     controller.classifier_function()
     self.assertTrue(controller.popup_format_error.called)
 def test_classifier_without_module(self):
     controller.askopenfilename = Mock(
         return_value='C:/school/guide_dog/resource/Data.csv')
     controller.popup_format_error = Mock(return_value='')
     controller.popup_msg = Mock(return_value='')
     controller.bar = Mock(return_value='')
     controller.classifier_function()
     self.assertTrue(controller.popup_msg.called)
 def test_one_row_valid_csv(self):
     controller.askopenfilename = Mock(
         return_value='C:/school/guide_dog/resource/Data.csv')
     controller.model_accuracy = Mock(return_value='')
     controller.bar = Mock(return_value='')
     controller.train_model()
     controller.askopenfilename = Mock(
         return_value='C:/school/guide_dog/resource/One row classifier.csv')
     controller.model_accuracy = Mock(return_value='')
     controller.popup_output = Mock(return_value='')
     controller.classifier_function()
     self.assertTrue(controller.popup_output.called)
    def test_classifier_with_module(self):
        controller.askopenfilename = Mock(
            return_value='C:/school/guide_dog/resource/Data.csv')
        controller.model_accuracy = Mock(return_value='')
        controller.popup_output = Mock(return_value='')
        controller.bar = Mock(return_value='')
        # popup that called after the classifier finished successfully
        controller.popup_output = Mock(return_value='')

        # First train the module
        controller.train_model()

        # Then run the classifier
        controller.askopenfilename = Mock(
            return_value='C:/school/guide_dog/resource/New dogs.csv')
        controller.classifier_function()
        self.assertTrue(controller.popup_output.called)
 def test_empty_path(self):
     controller.askopenfilename = Mock(return_value='')
     controller.popup_msg = Mock(return_value='')
     controller.classifier_function()
     self.assertTrue(controller.popup_msg.called)
 def test_call_pdf_file(self):
     controller.askopenfilename = Mock(
         return_value='C:/school/guide_dog/resource/pdf.pdf')
     controller.popup_msg = Mock(return_value='')
     controller.classifier_function()
     self.assertTrue(controller.popup_msg.called)