import pytest import json from feature_engineering import load_data, clean_data, add_features # Set up a temporary JSONL file @pytest.fixture def jsonl_file(tmp_path): sample_cases = [{'orderID': 10000, 'customerID': 48316, 'productID': [5620], 'paymentMthd': 'Cash on delivery', 'totalAmt': 9301.2, 'invoiceTime': '2024-06-10T23:30:29.608443', 'price': -1 }] file_path = tmp_path + "/test_transactions.jsonl" with open(file_path, 'w') as f: for txn in sample_cases: f.write(json.dumps(txn) + "n") return file_path # Test function to validate the `load_data` function def test_load_data(jsonl_file): data = load_data(jsonl_file) # assert statements here # Test function to validate the `clean_data` function def test_clean_data(jsonl_file): data = load_data(jsonl_file) data = clean_data(data) # assert statements here # Test function to validate the `add_features` function def test_add_features(jsonl_file): data = load_data(jsonl_file) data = clean_data(data) data = add_features(data) # assert statements here