def test_less_common_itunes_api(self): less_common = "moana" less_common2 = "helter skelter" m = proj1.get_from_url(less_common) m2 = proj1.get_from_url(less_common2) self.assertEqual(len(m), 20) self.assertEqual(len(m2), 20)
def test_common_itunes_api(self): common_param = ("baby", "love") common2_param = "baby" common3_param = "love" common = proj1.get_from_url(common_param) common2 = proj1.get_from_url(common2_param) common3 = proj1.get_from_url(common3_param) self.assertEqual(len(common), 20) self.assertEqual(len(common2), 20) self.assertEqual(len(common3), 20)
def test_itunes_api_type(self): param = "Miley Cyrus" t = proj1.get_from_url(param) self.assertEqual(type(t), list)
def test_blank_param_itunes_api(self): blank_param = "" m3 = proj1.get_from_url(blank_param) self.assertEqual(len(m3), 0)
def test_nonsense_itunes_api(self): nonsense_param = "doidsaofeinafqei" m2 = proj1.get_from_url(nonsense_param) self.assertEqual(len(m2), 0)