def test_clamp_samples_shouldfail(): samples = [10, 3, 4, 6, 2, 9, 8, 4, 3, 0, 2] average_sample = 4.636363637 incorrect_result = [1, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0] actual = pcm.clamp_samples(samples, average_sample) assert incorrect_result != actual
def test_clamp_samples_shouldpass(): samples = [10, 3, 4, 6, 2, 9, 8, 4, 3, 0, 2] average_sample = 4.636363637 expected = [1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0] actual = pcm.clamp_samples(samples, average_sample) assert expected == actual