File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
tests/test_neuromorphic_analytics Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change 1+ # tests/test_neuromorphic_analytics/test_data_pipeline.py
2+
3+ import unittest
4+ from src .neuromorphic_analytics .data_pipeline import DataPipeline
5+
6+ class TestDataPipeline (unittest .TestCase ):
7+ def setUp (self ):
8+ """Set up the Data Pipeline for testing."""
9+ self .data_sources = ['source1' , 'source2' ]
10+ self .data_pipeline = DataPipeline (self .data_sources )
11+
12+ def test_collect_data (self ):
13+ """Test the data collection functionality."""
14+ collected_data = self .data_pipeline .collect_data ()
15+ self .assertEqual (len (collected_data ), len (self .data_sources ) * 5 ) # Expecting 5 data points from each source
16+
17+ def test_preprocess_data (self ):
18+ """Test the data preprocessing functionality."""
19+ raw_data = [0.1 , 0.5 , 0.9 ]
20+ preprocessed_data = self .data_pipeline .preprocess_data (raw_data )
21+ self .assertEqual (len (preprocessed_data ), len (raw_data )) # Check if the length remains the same
22+ self .assertTrue (all (0 <= data <= 1 for data in preprocessed_data )) # Check if all data is normalized
23+
24+ if __name__ == '__main__' :
25+ unittest .main ()
You can’t perform that action at this time.
0 commit comments