Skip to content

Commit 4a61560

Browse files
authored
Create test_data_pipeline.py
1 parent 44bf988 commit 4a61560

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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()

0 commit comments

Comments
 (0)