diff --git a/onair/data_handling/csv_parser.py b/onair/data_handling/csv_parser.py index 96a59dd8..a5bb00b6 100644 --- a/onair/data_handling/csv_parser.py +++ b/onair/data_handling/csv_parser.py @@ -65,10 +65,3 @@ def get_next(self): # Return whether or not the index has finished traveling through the data def has_more(self): return self.frame_index < len(self.sim_data) - - # Return whether or not there is data - # TODO: This function may be removed with future clean-up - def has_data(self): - if self.sim_data == []: - return False - return True diff --git a/onair/data_handling/on_air_data_source.py b/onair/data_handling/on_air_data_source.py index 30129b0c..ce9a509b 100644 --- a/onair/data_handling/on_air_data_source.py +++ b/onair/data_handling/on_air_data_source.py @@ -60,10 +60,3 @@ def has_more(self): Used by file-based data to indicate if there are more frames (True) or if the end of the file has been reached (False) """ raise NotImplementedError - - @abstractmethod - def has_data(self): - """ - Used by live telemetry sources to indicate if new data has come in - """ - raise NotImplementedError diff --git a/test/onair/data_handling/test_csv_parser.py b/test/onair/data_handling/test_csv_parser.py index db1eb54b..fb1891fc 100644 --- a/test/onair/data_handling/test_csv_parser.py +++ b/test/onair/data_handling/test_csv_parser.py @@ -346,32 +346,3 @@ def test_CSV_has_more_returns_false_when_index_equal_than_number_of_frames(setup # Assert assert result == expected_result - -# CSV has_data test -def test_CSV_has_data_returns_true_sim_data_is_non_empty(setup_teardown): - # Arrange - fake_sim_data = MagicMock() - - expected_result = True - - pytest.cut.sim_data = fake_sim_data - - # Act - result = pytest.cut.has_data() - - # Assert - assert result == expected_result - -def test_CSV_has_data_returns_false_sim_data_is_empty(setup_teardown): - # Arrange - fake_sim_data = [] - - expected_result = False - - pytest.cut.sim_data = fake_sim_data - - # Act - result = pytest.cut.has_data() - - # Assert - assert result == expected_result diff --git a/test/onair/data_handling/test_on_air_data_source.py b/test/onair/data_handling/test_on_air_data_source.py index cfe0fad1..d5d8b1c6 100644 --- a/test/onair/data_handling/test_on_air_data_source.py +++ b/test/onair/data_handling/test_on_air_data_source.py @@ -28,9 +28,6 @@ def get_next(self): def has_more(self): return super().has_more() - def has_data(self): - return super().has_data() - class IncompleteOnAirDataSource(OnAirDataSource): pass @@ -47,9 +44,6 @@ def get_next(self): def has_more(self): return super().has_more() - def has_data(self): - return super().has_data() - @pytest.fixture def setup_teardown(): pytest.cut = FakeOnAirDataSource.__new__(FakeOnAirDataSource) @@ -101,7 +95,6 @@ def test_OnAirDataSource_raises_error_because_of_unimplemented_abstract_methods( assert "parse_meta_data_file" in e_info.__str__() assert "get_next" in e_info.__str__() assert "has_more" in e_info.__str__() - assert "has_data" in e_info.__str__() # Incomplete plugin call tests def test_OnAirDataSource_raises_error_when_an_inherited_class_is_instantiated_because_abstract_methods_are_not_implemented_by_that_class(): @@ -116,7 +109,6 @@ def test_OnAirDataSource_raises_error_when_an_inherited_class_is_instantiated_be assert "parse_meta_data_file" in e_info.__str__() assert "get_next" in e_info.__str__() assert "has_more" in e_info.__str__() - assert "has_data" in e_info.__str__() def test_OnAirDataSource_raises_error_when_an_inherited_class_calls_abstract_method_process_data_file(): # Act @@ -153,12 +145,3 @@ def test_OnAirDataSource_raises_error_when_an_inherited_class_calls_abstract_met with pytest.raises(NotImplementedError) as e_info: cut.has_more() assert "NotImplementedError" in e_info.__str__() - -def test_OnAirDataSource_raises_error_when_an_inherited_class_calls_abstract_method_has_data(): - # Act - cut = BadFakeOnAirDataSource.__new__(BadFakeOnAirDataSource) - - # populate list with the functions that should raise exceptions when called. - with pytest.raises(NotImplementedError) as e_info: - cut.has_data() - assert "NotImplementedError" in e_info.__str__()