def test_get_slice_returns_integer_based_slice_unaltered(self): scale = LinearScale(FrequencyBand(0, 100), 10) slce = scale.get_slice(slice(0, 20)) self.assertEqual(slice(0, 20), slce)
def test_get_slice_between_boundary(self): scale = LinearScale(FrequencyBand(0, 1000), 10) sl = scale.get_slice(FrequencyBand(495, 705)) self.assertEqual(slice(4, 8), sl)
def test_get_slice_converts_hz_based_slice_to_integer_based_slice(self): scale = LinearScale(FrequencyBand(0, 100), 10) slce = scale.get_slice(slice(Hertz(0), Hertz(20))) self.assertEqual(slice(0, 2), slce)
def test_get_slice_on_boundary(self): scale = LinearScale(FrequencyBand(0, 1000), 100) sl = scale.get_slice(FrequencyBand(500, 700)) self.assertEqual(slice(49, 70), sl)