-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
29 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,31 @@ | ||
import cleaning_description | ||
""" | ||
A test for checking cleaning description | ||
""" | ||
|
||
import os | ||
import pickle | ||
import pytest | ||
from src.duplicates_handler import remove_duplicates | ||
|
||
# Determine the absolute path of the project directory | ||
PROJECT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) | ||
INPUT_PICKLE_PATH = os.path.join(PROJECT_DIR, 'data', | ||
'processed','after_missing_values.pkl') | ||
OUTPUT_PICKLE_PATH = os.path.join(PROJECT_DIR, 'data', | ||
'processed', 'after_duplicates.pkl') | ||
|
||
|
||
def test_cleaning_description(): | ||
""" | ||
Test to check if correct descriptions have been removed | ||
""" | ||
result = cleaning_description(input_pickle_path=INPUT_PICKLE_PATH, | ||
output_pickle_path=OUTPUT_PICKLE_PATH) | ||
|
||
assert result == OUTPUT_PICKLE_PATH | ||
|
||
with open(OUTPUT_PICKLE_PATH, "rb") as file: | ||
df = pickle.load(file) | ||
|
||
def test_cleaning_description(imput_data_frame): | ||
|
||
#checking if correct descriptions have been removed | ||
assert len(df['Description'].isin(service_related_descriptions)) == 0 |