@@ -555,9 +555,14 @@ def test_get_starting_time_with_timestamps(self):
555555 ts = mock_TimeSeries (data = [1 , 2 , 3 ], timestamps = [2.5 , 3.5 , 4.5 ])
556556 self .assertEqual (ts .get_starting_time (), 2.5 )
557557
558- def test_get_starting_time_empty_data (self ):
559- """Test get_starting_time with empty data returns None"""
560- ts = mock_TimeSeries (data = [], rate = 10.0 )
558+ def test_get_starting_time_empty_data_with_starting_time (self ):
559+ """Test get_starting_time with empty data but defined starting_time"""
560+ ts = mock_TimeSeries (data = [], rate = 10.0 , starting_time = 5.0 )
561+ self .assertEqual (ts .get_starting_time (), 5.0 )
562+
563+ def test_get_starting_time_empty_data_no_starting_time (self ):
564+ """Test get_starting_time with empty data and no starting_time returns None"""
565+ ts = mock_TimeSeries (data = [], timestamps = [])
561566 self .assertIsNone (ts .get_starting_time ())
562567
563568 def test_get_duration_with_rate (self ):
@@ -580,9 +585,14 @@ def test_get_duration_single_sample(self):
580585 ts_timestamps = mock_TimeSeries (data = [1 ], timestamps = [5.0 ])
581586 self .assertEqual (ts_timestamps .get_duration (), 0.0 )
582587
583- def test_get_duration_empty_data (self ):
584- """Test get_duration with empty data returns None"""
585- ts = mock_TimeSeries (data = [], rate = 10.0 )
588+ def test_get_duration_empty_data_with_starting_time (self ):
589+ """Test get_duration with empty data but defined starting_time returns 0"""
590+ ts = mock_TimeSeries (data = [], rate = 10.0 , starting_time = 5.0 )
591+ self .assertEqual (ts .get_duration (), 0.0 )
592+
593+ def test_get_duration_empty_data_no_starting_time (self ):
594+ """Test get_duration with empty data and no starting_time returns None"""
595+ ts = mock_TimeSeries (data = [], timestamps = [])
586596 self .assertIsNone (ts .get_duration ())
587597
588598
0 commit comments