def test_train_run_whith_train_and_validate(self, mock_train, mock_validate, mock_load_model, mock_load, mock_stdout, mock_exists, mock_init, mock_init_t): run_model(True, True, False, True, False, 6) self.assertEqual(mock_train.call_count, 6)
def test_validate_runs_for_every_epoch(self, mock_validate, mock_load_model, mock_load, mock_exists, mock_init): run_model(False, True, False, True, False, 6) self.assertEqual(mock_validate.call_count, 6)
def test_train_runs_for_every_epoch(self, mock_train, mock_load_model, mock_load, mock_stdout, mock_exists, mock_init): run_model(True, False, False, True, False, 5) self.assertEqual(mock_train.call_count, 5)
def test_returns_predictor_output(self, mock_predict, mock_load_model, mock_load, mock_dataset, moc_data_loader, mock_options, mock_exists): predictor_output = run_model(False, False, True, True, False, 1) self.assertEqual(predictor_output, 'Predictor output')
def test_raises_error_if_check_fails(self, mock_check_vidframes, mock_exists): with self.assertRaises(ValueError): run_model(False, False, True, True, True, 1)
def test_validate_not_run_whith_train(self, mock_validate, mock_train, mock_load_model, mock_load, mock_stdout, mock_exists, mock_init): run_model(True, False, False, True, False, 1) self.assertEqual(mock_validate.call_count, 0)