def test_fetching_app_in_spanish(self): s = PlayScraper(hl='es', gl='es') app_data = s.details('com.android.chrome') self.assertTrue(all(key in app_data for key in DETAIL_KEYS)) self.assertEqual(len(DETAIL_KEYS), len(app_data.keys())) self.assertEqual('com.android.chrome', app_data['app_id']) self.assertEqual(['COMMUNICATION'], app_data['category']) # additional details are all None because we currently hardcode an # English mapping for the various additional info section titles. self.assertTrue(all([app_data[x] is None for x in ADDITIONAL_INFO_KEYS]))
def test_fetching_app_in_spanish(self): s = PlayScraper(hl='es', gl='es') app_data = s.details('com.android.chrome') self.assertTrue(all(key in app_data for key in DETAIL_KEYS)) self.assertEqual(len(DETAIL_KEYS), len(app_data.keys())) self.assertEqual('com.android.chrome', app_data['app_id']) self.assertEqual(['COMMUNICATION'], app_data['category']) self.assertTrue(all(x is not None and x.startswith('https://') for x in app_data['screenshots'])) # additional details, like installs, are all None because we currently # hardcode an English mapping for the various additional info section # titles. self.assertTrue(all([app_data[x] is None for x in ADDITIONAL_INFO_KEYS]))
def test_fetching_app_in_spanish(self): s = PlayScraper(hl="es", gl="es") app_data = s.details("com.android.chrome") self.assertTrue(all(key in app_data for key in DETAIL_KEYS)) self.assertEqual(len(DETAIL_KEYS), len(app_data.keys())) self.assertEqual("com.android.chrome", app_data["app_id"]) self.assertEqual(["COMMUNICATION"], app_data["category"]) self.assertTrue(app_data["screenshots"] and all(x is not None and x.startswith("https://") for x in app_data["screenshots"])) # additional details, like installs, are all None because we currently # hardcode an English mapping for the various additional info section # titles. self.assertTrue( all([app_data[x] is None for x in ADDITIONAL_INFO_KEYS]))