예제 #1
0
    def test_remove_symbol(self):
        # given
        attr1 = ProbabilityEnhancedAttribute({'0': 0.4, '1': 0.4, '9': 0.2})
        attr2 = ProbabilityEnhancedAttribute({'0': 0.5, '1': 0.5})

        # when
        assert attr1.remove_symbol('9')

        # then
        assert attr1 == attr2
예제 #2
0
    def test_remove_last_symbol(self):
        # given
        attr1 = ProbabilityEnhancedAttribute({'0': 1.0})
        attr2 = ProbabilityEnhancedAttribute({'0': 1.0})

        # when
        assert not attr1.remove_symbol('0')

        # then
        assert attr1 == attr2