def test_changing_sample_value_will_change_total_probability(): data = [{1: TRUE, 2: FALSE, 3: TRUE}, {1: FALSE, 2: FALSE, 3: FALSE}] key = FALSE probability_service = Probability() probability_service.calculate_for_many_samples(data, key) results = probability_service.total assert results == 0.25 probability_service.probability_samples[1] = 1 assert probability_service.total == 0.5
def test_should_calculate_probability_for_many_samples(data, key, expected): probability_service = Probability() results = probability_service.calculate_for_many_samples(data, key) assert results == expected