Skip to content

Commit

Permalink
edit makefile and add test to test.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ChinSekYi committed Jul 7, 2024
1 parent 8e4d400 commit d4918a3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ install:
pip install -r requirements.txt

test:
python -m pytest app.py
python -m pytest test.py
#--nbval notebook/EDA.ipynb notebook/MODEL_TRAINING.ipynb

format:
Expand Down
18 changes: 17 additions & 1 deletion test.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,23 @@
from src.components.data_ingestion import DataIngestion
from src.components.data_transformation import DataTransformation

def test_data_ingestion_output():
obj = DataIngestion()
train_data, test_data = obj.initiate_data_ingestion()
assert train_data == "artifacts/train.csv"
assert test_data == "artifacts/test.csv"
assert test_data == "artifacts/test.csv"


def test_data_transformation_output():
obj = DataTransformation()
preprocessor = obj.get_data_transformer_object()
assert preprocessor is not None

train_path = "artifacts/train.csv"
test_path = "artifacts/test.csv"

train_arr, test_arr, preprocessor_path = obj.initiate_data_transformation(train_path, test_path)

assert train_arr is not None
assert test_arr is not None
assert preprocessor_path is not None

0 comments on commit d4918a3

Please sign in to comment.