From a411a44628ea9bdbe450b136633ed2862ae681b2 Mon Sep 17 00:00:00 2001
From: rishi2019194 <58341663+rishi2019194@users.noreply.github.com>
Date: Tue, 17 Oct 2023 13:33:51 -0400
Subject: [PATCH] Update test_util.py
refactor the code
---
test/test_util.py | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/test/test_util.py b/test/test_util.py
index 42c187847..992b90894 100644
--- a/test/test_util.py
+++ b/test/test_util.py
@@ -5,10 +5,12 @@
import sys
import unittest
import warnings
-sys.path.append(str(Path(__file__).resolve().parents[1]))
+from pathlib import Path
import pandas as pd
+sys.path.append(str(Path(__file__).resolve().parents[1]))
#pylint: disable=wrong-import-position
-from src.recommenderapp.utils import create_colored_tags, beautify_feedback_data, create_movie_genres, send_email_to_user
+from src.recommenderapp.utils import create_colored_tags, \
+ beautify_feedback_data, create_movie_genres, send_email_to_user
#pylint: enable=wrong-import-position
warnings.filterwarnings("ignore")
@@ -35,7 +37,8 @@ def test_create_colored_tags(self):
"""
Test case 2
"""
- expected_result = 'Musical'
+ expected_result = 'Musical'
result = create_colored_tags(['Musical'])
self.assertTrue(result == expected_result)
@@ -43,7 +46,8 @@ def test_create_movie_genres(self):
"""
Test case 3
"""
- expected_result = {'Toy Story (1995)': ['Animation', 'Comedy', 'Family'], 'Jumanji (1995)': [
+ expected_result = {'Toy Story (1995)': ['Animation', 'Comedy', 'Family'], \
+ 'Jumanji (1995)': [
'Adventure', 'Fantasy', 'Family']}
movie_genre_df = pd.read_csv('../data/movies.csv').head(n=2)
result = create_movie_genres(movie_genre_df)