def test_interpolates_based_on_passed_points(self): self.assertEqual(interpolate_nones([1, None, 10], [1, 2, 10]), [1, 2, 10])
def test_copies_values_to_borders(self): self.assertEqual( interpolate_nones([None, None, 2, None, None], [1, 2, 3, 4, 5]), [2, 2, 2, 2, 2])
def test_copies_values_to_borders_when_everything_is_zero(self): self.assertEqual( interpolate_nones([None, 0, 0, 0, None], [1, 2, 3, 4, 5]), [0, 0, 0, 0, 0])
def test_interpolates_simple_nones(self): self.assertEqual( interpolate_nones([1, None, 3, None, 5], [1, 2, 3, 4, 5]), [1, 2, 3, 4, 5])
def test_interpolates_multiple_adjacent_nones(self): self.assertEqual( interpolate_nones([1, None, None, None, 5], [1, 2, 3, 4, 5]), [1, 2, 3, 4, 5])
def test_returns_false_when_no_valid_points(self): self.assertFalse(interpolate_nones([None, None, None], [1, 2, 3]))
def test_returns_full_array_when_no_nones(self): self.assertEqual(interpolate_nones([1, 2, 3], [1, 2, 3]), [1, 2, 3])
def test_interpolates_based_on_passed_points(self): self.assertEqual(sushi.interpolate_nones([1, None, 10], [1, 2, 10]), [1, 2, 10])
def test_returns_empty_array_when_passed_empty_array(self): self.assertEquals(interpolate_nones([], []), [])
def test_copies_values_to_borders(self): self.assertEqual(sushi.interpolate_nones([None, None, 2, None, None], [1, 2, 3, 4, 5]), [2, 2, 2, 2, 2])
def test_copies_values_to_borders_when_everything_is_zero(self): self.assertEqual(sushi.interpolate_nones([None, 0, 0, 0, None], [1, 2, 3, 4, 5]), [0, 0, 0, 0, 0])
def test_interpolates_multiple_adjacent_nones(self): self.assertEqual(sushi.interpolate_nones([1, None, None, None, 5], [1, 2, 3, 4, 5]), [1, 2, 3, 4, 5])
def test_interpolates_simple_nones(self): self.assertEqual(sushi.interpolate_nones([1, None, 3, None, 5], [1, 2, 3, 4, 5]), [1, 2, 3, 4, 5])
def test_returns_full_array_when_no_nones(self): self.assertEqual(sushi.interpolate_nones([1, 2, 3], [1, 2, 3]), [1, 2, 3])
def test_returns_false_when_no_valid_points(self): self.assertFalse(sushi.interpolate_nones([None, None, None], [1, 2, 3]))
def test_returns_empty_array_when_passed_empty_array(self): self.assertEquals(sushi.interpolate_nones([], []), [])