Skip to content

Commit

Permalink
updates_to_cleanining_description
Browse files Browse the repository at this point in the history
  • Loading branch information
baridamm committed Nov 9, 2023
1 parent ee0f281 commit 8518a04
Showing 1 changed file with 29 additions and 3 deletions.
32 changes: 29 additions & 3 deletions test/test_cleaning_description.py
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

0 comments on commit 8518a04

Please sign in to comment.