Example #1
0
    def test_hgram_bins_defined_valid_value(self):
        # The config should be considerd valid if LOSS_HISTOGRAM_BINS is
        # define and has a valid value.
        # The value must be >= 1.
        val = EventBasedRiskValidator(dict(LOSS_HISTOGRAM_BINS=1))
        self.assertTrue(val.is_valid()[0])

        val = EventBasedRiskValidator(dict(LOSS_HISTOGRAM_BINS=2))
        self.assertTrue(val.is_valid()[0])
Example #2
0
    def test_hgram_bins_defined_valid_value(self):
        # The config should be considerd valid if LOSS_HISTOGRAM_BINS is
        # define and has a valid value.
        # The value must be >= 1.
        val = EventBasedRiskValidator(dict(LOSS_HISTOGRAM_BINS=1))
        self.assertTrue(val.is_valid()[0])

        val = EventBasedRiskValidator(dict(LOSS_HISTOGRAM_BINS=2))
        self.assertTrue(val.is_valid()[0])
Example #3
0
 def test_hgram_bins_invalid_type(self):
     # An invalid type, in this case, is something that can't be cast to an
     # `int`.
     val = EventBasedRiskValidator(dict(LOSS_HISTOGRAM_BINS='one'))
     self.assertFalse(val.is_valid()[0])
Example #4
0
 def test_hgram_bins_not_defined(self):
     val = EventBasedRiskValidator(dict())
     self.assertFalse(val.is_valid()[0])
Example #5
0
    def test_hgram_bins_defined_invalid_value(self):
        val = EventBasedRiskValidator(dict(LOSS_HISTOGRAM_BINS=0))
        self.assertFalse(val.is_valid()[0])

        val = EventBasedRiskValidator(dict(LOSS_HISTOGRAM_BINS=-1))
        self.assertFalse(val.is_valid()[0])
Example #6
0
 def test_hgram_bins_invalid_type(self):
     # An invalid type, in this case, is something that can't be cast to an
     # `int`.
     val = EventBasedRiskValidator(dict(LOSS_HISTOGRAM_BINS='one'))
     self.assertFalse(val.is_valid()[0])
Example #7
0
 def test_hgram_bins_not_defined(self):
     val = EventBasedRiskValidator(dict())
     self.assertFalse(val.is_valid()[0])
Example #8
0
    def test_hgram_bins_defined_invalid_value(self):
        val = EventBasedRiskValidator(dict(LOSS_HISTOGRAM_BINS=0))
        self.assertFalse(val.is_valid()[0])

        val = EventBasedRiskValidator(dict(LOSS_HISTOGRAM_BINS=-1))
        self.assertFalse(val.is_valid()[0])