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)
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()
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']")
def __init__(self, args): super(MovielensRatingsParser, self).__init__(Movielens(args), args) self.downloaded_file_name = "movielens-ratings.csv"
def setUp(self): self.site = Movielens(None)
def __init__(self, args): super(MovielensRatingsParser, self).__init__(Movielens(args), args)