def test_getItunesData(self): m1 = proj1.get_itunes_data(search_term="") self.assertEqual(len(m1), 0) m2 = proj1.get_itunes_data(search_term="love") self.assertEqual(len(m2) <= 50, True) m3 = proj1.get_itunes_data(search_term="baby") self.assertEqual(len(m3) <= 50, True) m4 = proj1.get_itunes_data(search_term="") self.assertEqual(len(m4) <= 50, True) m5 = proj1.get_itunes_data(search_term="##!!") self.assertEqual(len(m5), 0) m6 = proj1.get_itunes_data(search_term="moana") self.assertEqual(len(m6) <= 50, True) m7 = proj1.get_itunes_data(search_term="helter skelter") self.assertEqual(len(m7) <= 50, True) m8 = proj1.get_itunes_data(search_term="demirjian") self.assertEqual(len(m8) <= 50, True) m9 = proj1.get_itunes_data(search_term="palig") self.assertEqual(len(m9) <= 50, True)
def test_blank(self): search1 = proj1.get_itunes_data('', 19) self.assertEqual(search1['resultCount'], 0)
def test_nonsense_words(self): search1 = proj1.get_itunes_data('sadfasdgas', 4) search2 = proj1.get_itunes_data('&DGSF*#', 23) self.assertEqual(search1['resultCount'], 0) self.assertEqual(search2['resultCount'], 0)
def test_less_common_words(self): search1 = proj1.get_itunes_data("moana", 12) search2 = proj1.get_itunes_data("helter skelter", 5) self.assertEqual(search1['resultCount'], 12) self.assertEqual(search2['resultCount'], 5)
def test_common_words(self): search1 = proj1.get_itunes_data("baby", 50) search2 = proj1.get_itunes_data("love", 50) self.assertEqual(search1['resultCount'], 50) self.assertEqual(search2['resultCount'], 50)