Skip to content

Commit

Permalink
Fixed bug in test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
adipai committed Oct 17, 2023
1 parent a411a44 commit a71ebac
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions test/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ def test_create_colored_tags(self):
"""
Test case 2
"""
expected_result = '<span style="background-color: #FF1493; color: #FFFFFF; \
padding: 5px; border-radius: 5px;">Musical</span>'
expected_result = '<span style="background-color: #FF1493; color: #FFFFFF; \
padding: 5px; border-radius: 5px;">Musical</span>'
result = create_colored_tags(['Musical'])
self.assertTrue(result == expected_result)

Expand All @@ -49,7 +49,15 @@ def test_create_movie_genres(self):
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)

data = [["862", "Toy Story (1995)", "Animation|Comedy|Family", \
"tt0114709", " ", "/rhIRbceoE9lR4veEXuwCC2wARtG.jpg", "81"], \
["8844", "Jumanji (1995)", "Adventure|Fantasy|Family", "tt0113497", " ", \
"/vzmL6fP7aPKNKPRTFnZmiUfciyV.jpg", "104"]]

movie_genre_df = pd.DataFrame(data, columns=[
'movieId', 'title', 'genres', 'imdb_id', 'overview', 'poster_path', 'runtime'])

result = create_movie_genres(movie_genre_df)
self.assertTrue(result == expected_result)

Expand Down

0 comments on commit a71ebac

Please sign in to comment.