示例#1
0
 def test_builds_a_neural_net_using_the_computed_max_length(self):
     TestHelper.assertCallParameter(self.UpdateTestData.data.max_length,
                                    self.NeuralNetBuilderService.call, 0)
示例#2
0
 def test_builds_a_neural_net_using_the_computed_number_of_output_neurons(
         self):
     TestHelper.assertCallParameter(
         self.UpdateTestData.data.numberOfOutputNeurons,
         self.NeuralNetBuilderService.call, 1)
示例#3
0
 def test_askUserForChoice_displays_prompt(self):
     TestHelper.assertCallParameter(self.UiTestData.PROMPT,
                                    self.mockedInput, 0)
示例#4
0
 def test_the_database_row_with_the_the_oid_for_the_row_computed_from_problemoids_is_obtained(
         self):
     self.runTest(self.choice)
     TestHelper.assertCallParameter(self.UpdateTestData.oidAsStr,
                                    self.RowProviderService.call, 1)
示例#5
0
 def test_updates_categories_based_on_predictions(self):
     TestHelper.assertCallParameter(self.UpdateTestData.data,
                                    self.UpdateService.call, 0)
 def test_prepareOptionsToOffer_displays_probability(self):
     TestHelper.assertCallParameter(self.UpdateTestData.data.problemValues[0][2], self.OptionDisplayService.call, 1)
示例#7
0
 def test_the_oid_passed_to_update_is_the_oid_for_the_row(self):
     self.runTest(self.choice)
     TestHelper.assertCallParameter(self.UpdateTestData.oidAsStr,
                                    self.UpdateDBService.call, 1)
示例#8
0
 def test_uses_the_trained_neural_net_to_get_the_predictions_from_problemValues(
         self):
     TestHelper.assertCallParameter(self.UpdateTestData.data.problemValues,
                                    self.AiTestData.model.predict, 0)
示例#9
0
 def test_option_preparation_uses_the_categories(self):
     self.runTest(self.choice)
     TestHelper.assertCallParameter(self.UpdateTestData.categories,
                                    self.OptionPreparatorService.call, 2)
示例#10
0
 def test_the_choice_passed_to_update_is_the_choice_obtained(self):
     self.runTest(self.choice)
     TestHelper.assertCallParameter(self.choice, self.UpdateDBService.call,
                                    3)
示例#11
0
 def test_option_preparation_uses_the_row_number(self):
     self.runTest(self.choice)
     TestHelper.assertCallParameter(self.UpdateTestData.rowNumber,
                                    self.OptionPreparatorService.call, 0)
示例#12
0
 def test_the_database_row_is_displayed(self):
     self.runTest(self.choice)
     TestHelper.assertCallParameter(self.DbTestData.fetched_row,
                                    self.TransactionDisplayService.call, 0)
示例#13
0
 def test_the_database_row_is_obtained_through_the_connections(self):
     self.runTest(self.choice)
     TestHelper.assertCallParameter(self.DbTestData.connection,
                                    self.RowProviderService.call, 0)
示例#14
0
 def test_trains_the_built_model(self):
     TestHelper.assertCallParameter(self.AiTestData.model,
                                    self.NeuralNetTrainerService.call, 2)
示例#15
0
 def test_the_database_row_is_updated_through_the_connections(self):
     self.runTest(self.choice)
     TestHelper.assertCallParameter(self.DbTestData.connection,
                                    self.UpdateDBService.call, 0)
示例#16
0
 def test_trains_the_built_model_using_training_results(self):
     TestHelper.assertCallParameter(self.UpdateTestData.data.trainResults,
                                    self.NeuralNetTrainerService.call, 1)
示例#17
0
 def test_checkAccuracy_displays_accuracy(self):
     self.runTestWithAccuracy(self.AiTestData.ACCURACY)
     TestHelper.assertCallParameter(self.AiTestData.ACCURACY,
                                    self.DisplayAccuracyService.call, 0)
示例#18
0
 def test_checks_the_accuracy_of_the_built_modell(self):
     TestHelper.assertCallParameter(self.AiTestData.ACCURACY,
                                    self.AccuracyCheckService.call, 0)
示例#19
0
 def test_checkAccuracy_exits_when_accuracy_is_low(self):
     self.runTestWithAccuracy(self.AiTestData.LOW_ACCURACY)
     TestHelper.assertCallParameter(-1, self.sysExit, 0)
 def test_prepareOptionsToOffer_displays_choice_key(self):
     TestHelper.assertCallParameter(self.UpdateTestData.resultKeys[0], self.OptionDisplayService.call, 0)
示例#21
0
 def test_it_prepares_data_with_the_loaded_train_set(self):
     TestHelper.assertCallParameter(self.DataTestData.TRAIN_SET,
                                    self.PrepareDataService.call,
                                    0,
                                    prepareForCheck=lambda x: x.to_dict())
 def test_prepareOptionsToOffer_displays_categories(self):
     TestHelper.assertCallParameter(self.UpdateTestData.categories[3], self.OptionDisplayService.call, 2)
示例#23
0
 def test_it_prepares_data_with_the_loaded_problem_set(self):
     TestHelper.assertCallParameter(self.DataTestData.PROBLEM_SET,
                                    self.PrepareDataService.call,
                                    1,
                                    prepareForCheck=lambda x: x.to_dict())
示例#24
0
 def test_executes_SQL_TO_OBTAIN_CATEGORIES(self):
     self.fakeConnection.cursor.execute.assert_called_once()
     TestHelper.assertCallParameter(config.SQL_TO_OBTAIN_CATEGORIES,
                                    self.fakeConnection.cursor.execute, 0)
 def test_executes_the_formatted_update_query(self):
     TestHelper.assertCallParameter(self.DbTestData.formattedUpdateQuery,
                                    self.fakeConnection.cursor.execute, 0)
     self.fakeConnection.cursor.execute.assert_called_once()