Beispiel #1
0
 def test_venue_yelpID(self):
     venue = Venue.create("xaTGgwLwFGopzr1VlpBuBw", "ACL")
     result = venue.yelpID
     self.assertTrue(isinstance(result, str))
        #url = "https://api.yelp.com/v3/businesses/search?location=austin&term=" + concertlist[2].venue + "&limit=50"

        response = requests.request("GET", url, headers=headers, data={})
        parsed = json.loads(response.text)
        try:
            businesses = parsed["businesses"]
        except:
            continue
        if len(businesses) != 0:
            business = businesses[0]
            id = business["id"]
            name = business["name"]
            print(name)

            if (id) in venue_concert_dict:
                listitems = venue_concert_dict[id]
                listitems.append(c.concertName)
                venue_concert_dict[id] = listitems
                #venue_concert_dict[id].append(concertlist[2].concertName)
            else:
                venue_concert_dict[id] = [c.concertName]
                #venue_concert_dict[id] = [concertlist[2].concertName]

            print(venue_concert_dict[id])

for key in venue_concert_dict:
    venue = Venue.create(key, venue_concert_dict[key])
    print(venue)
    if venue is not None:
        venue.save()
Beispiel #3
0
 def test_venue_reviewCount(self):
     venue = Venue.create("xaTGgwLwFGopzr1VlpBuBw", "ACL")
     result = venue.reviewCount
     self.assertEqual(result, 243)
Beispiel #4
0
 def test_venue_rating(self):
     venue = Venue.create("xaTGgwLwFGopzr1VlpBuBw", "ACL")
     result = venue.rating
     self.assertTrue(isinstance(result, float))
Beispiel #5
0
 def test_venue_location(self):
     venue = Venue.create("xaTGgwLwFGopzr1VlpBuBw", "ACL")
     result = venue.location
     self.assertEqual(result, "912 Red River St Austin, TX 78701")
Beispiel #6
0
 def test_venue_name(self):
     venue = Venue.create("xaTGgwLwFGopzr1VlpBuBw", "ACL")
     result = venue.name
     self.assertEqual(result, "Mohawk")
Beispiel #7
0
 def test_venue_longitude(self):
     venue = Venue.create("xaTGgwLwFGopzr1VlpBuBw", "ACL")
     result = venue.longitude
     self.assertTrue(isinstance(result, float))
Beispiel #8
0
 def test_venue_location(self):
     venue = Venue.create("xaTGgwLwFGopzr1VlpBuBw", "ACL")
     result = venue.location
     self.assertTrue(isinstance(result, str))
Beispiel #9
0
 def test_venue_imageURL(self):
     venue = Venue.create("xaTGgwLwFGopzr1VlpBuBw", "ACL")
     result = venue.imageURL
     self.assertTrue(isinstance(result, str))