Ejemplo n.º 1
0
    def test_get_json_from_html(self, init_browser_mock, browser_mock):
        site = Movielens(None)
        site.browser = browser_mock
        browser_mock.find_element_by_tag_name.return_value.text = self.my_ratings_pre

        result = site.get_json_from_html()

        self.assertEqual(self.my_ratings_json, result)
Ejemplo n.º 2
0
class MovielensSiteTest(TestCase):
    def setUp(self):
        self.site = Movielens(None)

    def test_login(self):
        self.assertEqual('https://movielens.org/home', self.site.browser.current_url)

    def tearDown(self):
        self.site.kill_browser()
Ejemplo n.º 3
0
 def __init__(self, args):
     super(MovielensRatingsInserter, self).__init__(Movielens(args), args)
     self.url_for_csv_file_upload = (
         "https://movielens.org/profile/settings/import-export")
     self.css_id_of_file_input_element = "infile"
     self.xpath_selector_for_submit_button = (
         "//form[@name='importForm']//button[@type='submit']")
Ejemplo n.º 4
0
 def __init__(self, args):
     super(MovielensRatingsParser, self).__init__(Movielens(args), args)
     self.downloaded_file_name = "movielens-ratings.csv"
Ejemplo n.º 5
0
 def setUp(self):
     self.site = Movielens(None)
Ejemplo n.º 6
0
 def __init__(self, args):
     super(MovielensRatingsParser, self).__init__(Movielens(args), args)