Beispiel #1
0
    def test_parser(self, site_mock, base_init_mock, browser_mock, rename_csv_mock, parse_csv_mock):  # pylint: disable=too-many-arguments
        parser = MovielensRatingsParser(None)
        parser.movies = []
        parser.site = site_mock
        parser.site.site_name = 'Movielens'
        parser.site.browser = browser_mock
        parser.exports_folder = os.path.abspath(os.path.join(TESTDATA_PATH, 'exports'))
        parser.csv_filename = '1234567890_movielens.csv'

        parser.parse()

        self.assertEqual(1, rename_csv_mock.call_count)
        self.assertEqual(1, parse_csv_mock.call_count)
    def test_parser(self, site_mock, base_init_mock, browser_mock,
                    rename_csv_mock, parse_csv_mock):  # pylint: disable=too-many-arguments
        parser = MovielensRatingsParser(None)
        parser.movies = []
        parser.site = site_mock
        parser.site.site_name = "Movielens"
        parser.site.browser = browser_mock
        parser.exports_folder = os.path.abspath(
            os.path.join(TESTDATA_PATH, "exports"))
        parser.csv_filename = "1234567890_movielens.csv"
        parser.downloaded_file_name = os.path.join(os.pardir, "movielens",
                                                   "my_ratings.csv")

        parser.parse()

        self.assertEqual(1, rename_csv_mock.call_count)
        self.assertEqual(1, parse_csv_mock.call_count)