def test_random_variance(self):
        d = Capability()
        d.vss = 4.0
        d.variance = 0.5

        real_vss = d.calculate_vss(method='random')
        assert real_vss >= d.vss - d.variance
        assert real_vss <= d.vss + d.variance
Esempio n. 2
0
    def test_random_variance(self):
        d = Capability()
        d.vss = 4.0
        d.variance = 0.5

        real_vss = d.calculate_vss(method='random')
        assert real_vss >= d.vss - d.variance
        assert real_vss <= d.vss + d.variance
    def test_gaussian_variance(self):
        d = Capability()
        d.vss = 4.0
        d.variance = 0.5

        max_deviation = d.variance * 6

        real_vss = d.calculate_vss(method='gaussian')
        assert real_vss >= d.vss - max_deviation
        assert real_vss <= d.vss + max_deviation
Esempio n. 4
0
    def test_gaussian_variance(self):
        d = Capability()
        d.vss = 4.0
        d.variance = 0.5

        max_deviation = d.variance * 6

        real_vss = d.calculate_vss(method='gaussian')
        assert real_vss >= d.vss - max_deviation
        assert real_vss <= d.vss + max_deviation
    def test_error_variance(self):
        d = Capability()
        d.vss = 4.0
        d.variance = 0.5

        # Should result in a ValueError
        try:
            d.calculate_vss(method='nada')
        except ValueError:
            assert True
        else:
            assert False
Esempio n. 6
0
    def test_error_variance(self):
        d = Capability()
        d.vss = 4.0
        d.variance = 0.5

        # Should result in a ValueError
        try:
            d.calculate_vss(method='nada')
        except ValueError:
            assert True
        else:
            assert False