Example #1
0
    def test_lrem_steps_defined_invalid_value(self):
        # LREM_STEPS_PER_INTERVAL values < 1 are not allowed.
        val = ClassicalRiskValidator(dict(LREM_STEPS_PER_INTERVAL=0))
        self.assertFalse(val.is_valid()[0])

        val = ClassicalRiskValidator(dict(LREM_STEPS_PER_INTERVAL=-1))
        self.assertFalse(val.is_valid()[0])
Example #2
0
    def test_lrem_steps_defined_valid_value(self):
        # The config should be considered valid if LREM_STEPS_PER_INTERVAL is
        # defined and has a valid value.
        # The value must be >= 1
        val = ClassicalRiskValidator(dict(LREM_STEPS_PER_INTERVAL=1))
        self.assertTrue(val.is_valid()[0])

        val = ClassicalRiskValidator(dict(LREM_STEPS_PER_INTERVAL=2))
        self.assertTrue(val.is_valid()[0])
Example #3
0
    def test_lrem_steps_defined_invalid_value(self):
        # LREM_STEPS_PER_INTERVAL values < 1 are not allowed.
        val = ClassicalRiskValidator(dict(LREM_STEPS_PER_INTERVAL=0))
        self.assertFalse(val.is_valid()[0])

        val = ClassicalRiskValidator(dict(LREM_STEPS_PER_INTERVAL=-1))
        self.assertFalse(val.is_valid()[0])
Example #4
0
    def test_lrem_steps_defined_valid_value(self):
        # The config should be considered valid if LREM_STEPS_PER_INTERVAL is
        # defined and has a valid value.
        # The value must be >= 1
        val = ClassicalRiskValidator(dict(LREM_STEPS_PER_INTERVAL=1))
        self.assertTrue(val.is_valid()[0])

        val = ClassicalRiskValidator(dict(LREM_STEPS_PER_INTERVAL=2))
        self.assertTrue(val.is_valid()[0])
Example #5
0
 def test_lrem_steps_invalid_type(self):
     # An invalid type, in this case, is something that can't be cast to an
     # `int`.
     val = ClassicalRiskValidator(dict(LREM_STEPS_PER_INTERVAL='one'))
     self.assertFalse(val.is_valid()[0])
Example #6
0
 def test_lrem_steps_not_defined(self):
     val = ClassicalRiskValidator(dict())
     self.assertFalse(val.is_valid()[0])
Example #7
0
 def test_lrem_steps_invalid_type(self):
     # An invalid type, in this case, is something that can't be cast to an
     # `int`.
     val = ClassicalRiskValidator(dict(LREM_STEPS_PER_INTERVAL='one'))
     self.assertFalse(val.is_valid()[0])
Example #8
0
 def test_lrem_steps_not_defined(self):
     val = ClassicalRiskValidator(dict())
     self.assertFalse(val.is_valid()[0])