def test_refreshShowIndex(): show_cnt = ShowBusiness.getShowCount() newnum = ShowScrape.refreshShowIndex(650) assert ShowBusiness.getShowCount() == newnum+show_cnt ## do it twice and make sure it doesn't repeat ShowScrape.refreshShowIndex(600) assert ShowBusiness.getShowCount() == newnum+show_cnt
def test_refreshShowIndex(): latest = ShowScrape.parseShowIndexPage(ShowScrape.fetchPage(ShowScrape.INDEX_URL)) assert len(latest["shows"]) > 0 span = 3 until = int(latest["shows"][0]["number"]) - span num_shows_processed = ShowScrape.refreshShowIndex(until=until) assert num_shows_processed == span
def update_shows(): tot = ShowScrape.refreshShowIndex() return "%s shows scheduled for update" % (tot,)