def test_insertRows_in_the_end_with_only_one_value(self): model = TimeSeriesModelVariableResolution( TimeSeriesVariableResolution(["2019-07-05T12:00"], [-5.0], True, False)) self.assertTrue(model.insertRows(1, 1)) self.assertEqual( model.value, TimeSeriesVariableResolution( ["2019-07-05T12:00", "2019-07-05T13:00"], [-5.0, 0.0], True, False), )
def test_insertRows_at_the_beginning_with_only_one_value(self): model = TimeSeriesModelVariableResolution( TimeSeriesVariableResolution(["2019-07-05T12:00"], [-5.0], True, False)) self.assertTrue(model.insertRows(0, 1)) self.assertEqual( model.value, TimeSeriesVariableResolution( ["2019-07-05T11:00", "2019-07-05T12:00"], [0.0, -5.0], True, False), )
def test_insertRows_single_row_in_the_middle(self): model = TimeSeriesModelVariableResolution( TimeSeriesVariableResolution( ["2019-07-05T12:00", "2019-07-21T12:00"], [-5.0, 7.0], True, False)) self.assertTrue(model.insertRows(1, 1)) self.assertEqual( model.value, TimeSeriesVariableResolution( ["2019-07-05T12:00", "2019-07-13T12:00", "2019-07-21T12:00"], [-5.0, 0.0, 7.0], True, False), )
def test_insertRows_in_the_end(self): model = TimeSeriesModelVariableResolution( TimeSeriesVariableResolution( ["2019-07-05T12:00", "2019-07-21T12:00"], [-5.0, 7.0], True, False)) self.assertTrue(model.insertRows(2, 1)) self.assertEqual( model.value, TimeSeriesVariableResolution( ["2019-07-05T12:00", "2019-07-21T12:00", "2019-08-06T12:00"], [-5.0, 7.0, 0.0], True, False), )