예제 #1
0
    def test_load_movies_from_csv(self):
        parsed_movies = file_impex.load_movies_from_csv(os.path.join(TESTDATA_PATH, 'imdb', 'my_ratings.csv'))

        self.assertEqual(2, len(parsed_movies))
        self.assertEqual(dict, type(parsed_movies[0]))
        self.assertEqual('Arrival', parsed_movies[0]['title'])
        self.assertEqual(2016, parsed_movies[0]['year'])
        self.assertEqual('tt2543164', parsed_movies[0]['imdb']['id'])
        self.assertEqual('https://www.imdb.com/title/tt2543164/', parsed_movies[0]['imdb']['url'])
        self.assertEqual(7, parsed_movies[0]['imdb']['my_rating'])
예제 #2
0
    def test_load_movies_from_csv(self):
        parsed_movies = file_impex.load_movies_from_csv(
            os.path.join(TESTDATA_PATH, "imdb", "my_ratings.csv"))

        self.assertEqual(2, len(parsed_movies))
        self.assertEqual(dict, type(parsed_movies[0]))
        self.assertEqual("Arrival", parsed_movies[0]["title"])
        self.assertEqual(2016, parsed_movies[0]["year"])
        self.assertEqual("tt2543164", parsed_movies[0]["imdb"]["id"])
        self.assertEqual("https://www.imdb.com/title/tt2543164/",
                         parsed_movies[0]["imdb"]["url"])
        self.assertEqual(7, parsed_movies[0]["imdb"]["my_rating"])