Exemplo n.º 1
0
    def test_set_max_trials_with_exit_policy(self) -> None:
        """Test overwriting max_trials in Tuning config."""
        tuning = Tuning({
            "exit_policy": {
                "max_trials": 60,
            },
        }, )
        self.assertIsNotNone(tuning.exit_policy)
        self.assertEqual(tuning.exit_policy.max_trials, 60)

        tuning.set_max_trials(10)
        self.assertIsNotNone(tuning.exit_policy)
        self.assertEqual(tuning.exit_policy.max_trials, 10)
Exemplo n.º 2
0
 def test_set_max_trials_invalid_string(self) -> None:
     """Test overwriting max_trials in Tuning config."""
     tuning = Tuning()
     with self.assertRaises(ClientErrorException):
         tuning.set_max_trials("abc")
Exemplo n.º 3
0
 def test_set_max_trials_negative(self) -> None:
     """Test overwriting max_trials in Tuning config."""
     tuning = Tuning()
     with self.assertRaises(ClientErrorException):
         tuning.set_max_trials(-1)
Exemplo n.º 4
0
 def test_set_max_trials_from_string(self) -> None:
     """Test overwriting max_trials in Tuning config."""
     tuning = Tuning()
     tuning.set_max_trials("10")
     self.assertIsNotNone(tuning.exit_policy)
     self.assertEqual(tuning.exit_policy.max_trials, 10)
Exemplo n.º 5
0
 def test_set_max_trials(self) -> None:
     """Test setting max_trials in Tuning config."""
     tuning = Tuning()
     tuning.set_max_trials(10)
     self.assertIsNotNone(tuning.exit_policy)
     self.assertEqual(tuning.exit_policy.max_trials, 10)