Fix generating pytest for training service
This commit is contained in:
@@ -25,13 +25,16 @@ class TestBakeryDataProcessor:
|
||||
|
||||
@pytest.fixture
|
||||
def sample_sales_data(self):
|
||||
"""Create sample sales data"""
|
||||
dates = pd.date_range('2024-01-01', periods=60, freq='D')
|
||||
return pd.DataFrame({
|
||||
'date': dates,
|
||||
'product_name': ['Pan Integral'] * 60,
|
||||
'quantity': [45 + np.random.randint(-10, 11) for _ in range(60)]
|
||||
})
|
||||
"""Provide sufficient data for ML training tests"""
|
||||
dates = pd.date_range('2024-01-01', periods=35, freq='D') # 35 days > 30 minimum
|
||||
data = []
|
||||
for date in dates:
|
||||
data.append({
|
||||
'date': date,
|
||||
'product_name': 'Pan Integral', # Ensure this column exists
|
||||
'quantity': 40 + (5 * np.sin(date.dayofyear / 365 * 2 * np.pi)) # Seasonal pattern
|
||||
})
|
||||
return pd.DataFrame(data)
|
||||
|
||||
@pytest.fixture
|
||||
def sample_weather_data(self):
|
||||
|
||||
Reference in New Issue
Block a user